Line 1... |
Line 1... |
1 |
#!/bin/bash
|
1 |
#!/bin/bash
|
2 |
# $Id: alcasar-rpm-download.sh 1983 2016-07-08 10:14:42Z raphael.pion $
|
2 |
# $Id: alcasar-rpm-download.sh 1985 2016-07-08 17:33:09Z richard $
|
3 |
|
3 |
|
4 |
# alcasar-urpmi.sh
|
4 |
# alcasar-urpmi.sh
|
5 |
# by Franck BOUIJOUX and Richard REY
|
5 |
# by Franck BOUIJOUX and Richard REY
|
6 |
# This script is distributed under the Gnu General Public License (GPL)
|
6 |
# This script is distributed under the Gnu General Public License (GPL)
|
7 |
|
7 |
|
Line 9... |
Line 9... |
9 |
# retrieve needed RPM in a tarball file
|
9 |
# retrieve needed RPM in a tarball file
|
10 |
|
10 |
|
11 |
VERSION="5"
|
11 |
VERSION="5"
|
12 |
ARCH="i586"
|
12 |
ARCH="i586"
|
13 |
# ****** Alcasar needed RPMS - paquetages nécessaires au fonctionnement d'Alcasar ******
|
13 |
# ****** Alcasar needed RPMS - paquetages nécessaires au fonctionnement d'Alcasar ******
|
14 |
PACKAGES="vim-enhanced freeradius freeradius-mysql freeradius-ldap apache apache-mod_ssl apache-mod_php dansguardian postfix mariadb ntp bind-utils openssh-server php-xml php-ldap php-mysql php-mysqli php-mbstring php-sockets php-cli php-curl php-pdo_sqlite php-json rng-utils rsync clamav perl-rrdtool perl-MailTools perl-Socket6 fail2ban gnupg ulogd pm-fallback-policy ipset cronie-anacron gammu usbutils locales-en usb_modeswitch tinyproxy vnstat php-gd sudo iftop man"
|
14 |
PACKAGES="vim-enhanced freeradius freeradius-mysql freeradius-ldap apache apache-mod_ssl apache-mod_php dansguardian postfix mariadb ntp bind-utils openssh-server php-xml php-ldap php-mysql php-mysqli php-mbstring php-sockets php-cli php-curl php-pdo_sqlite php-json rng-utils rsync clamav perl-rrdtool perl-MailTools perl-Socket6 fail2ban gnupg ulogd pm-fallback-policy ipset cronie-anacron gammu usbutils locales-en usb_modeswitch tinyproxy vnstat php-gd sudo iftop man kernel-firmware-nonfree"
|
15 |
|
15 |
|
16 |
rpm_repository_sync ()
|
16 |
rpm_repository_sync ()
|
17 |
{
|
17 |
{
|
18 |
cat <<EOF > /etc/urpmi/urpmi.cfg
|
18 |
cat <<EOF > /etc/urpmi/urpmi.cfg
|
19 |
{
|
19 |
{
|
20 |
downloader: wget
|
20 |
downloader: wget
|
21 |
}
|
21 |
}
|
22 |
EOF
|
22 |
EOF
|
23 |
urpmi.addmedia --probe-synthesis --mirrorlist ${!MIRRORLIST} core /media/core/release
|
23 |
urpmi.addmedia core --probe-synthesis --mirrorlist ${!MIRRORLIST} /media/core/release
|
24 |
urpmi.addmedia --update --probe-synthesis --mirrorlist ${!MIRRORLIST} core_updates /media/core/updates
|
24 |
urpmi.addmedia core-updates --update --probe-synthesis --mirrorlist ${!MIRRORLIST} /media/core/updates
|
25 |
urpmi.addmedia --probe-synthesis --mirrorlist ${!MIRRORLIST} non-free /media/nonfree/release
|
25 |
urpmi.addmedia nonfree --probe-synthesis --mirrorlist ${!MIRRORLIST} /media/nonfree/release
|
- |
|
26 |
urpmi.addmedia nonfree-updates --update --probe-synthesis --mirrorlist ${!MIRRORLIST} /media/nonfree/updates
|
26 |
}
|
27 |
}
|
27 |
|
28 |
|
28 |
rpm_error ()
|
29 |
rpm_error ()
|
29 |
{
|
30 |
{
|
30 |
echo
|
31 |
echo
|
Line 58... |
Line 59... |
58 |
# For french ALCASARistes
|
59 |
# For french ALCASARistes
|
59 |
MIRRORLIST1="http://www.mirrorservice.org/sites/mageia.org/pub/mageia/distrib/$VERSION/$ARCH"
|
60 |
MIRRORLIST1="http://www.mirrorservice.org/sites/mageia.org/pub/mageia/distrib/$VERSION/$ARCH"
|
60 |
# For International install
|
61 |
# For International install
|
61 |
MIRRORLIST2="http://mirrors.mageia.org/api/mageia.$VERSION.$ARCH.list"
|
62 |
MIRRORLIST2="http://mirrors.mageia.org/api/mageia.$VERSION.$ARCH.list"
|
62 |
try_nb="0"; nb_repository="0"
|
63 |
try_nb="0"; nb_repository="0"
|
63 |
while [ "$nb_repository" != "3" ]
|
64 |
while [ "$nb_repository" != "4" ]
|
64 |
do
|
65 |
do
|
65 |
try_nb=`expr $try_nb + 1`
|
66 |
try_nb=`expr $try_nb + 1`
|
66 |
MIRRORLIST="MIRRORLIST$try_nb"
|
67 |
MIRRORLIST="MIRRORLIST$try_nb"
|
67 |
rpm_repository_sync
|
68 |
rpm_repository_sync
|
68 |
nb_repository=`cat /etc/urpmi/urpmi.cfg|grep mirrorlist|wc -l`
|
69 |
nb_repository=`cat /etc/urpmi/urpmi.cfg|grep mirrorlist|wc -l`
|
69 |
if [ "$nb_repository" != "3" ]
|
70 |
if [ "$nb_repository" != "4" ]
|
70 |
then
|
71 |
then
|
71 |
echo "Une erreur a été détectée lors de la synchronisation avec le dépot N°$try_nb."
|
72 |
echo "Une erreur a été détectée lors de la synchronisation avec le dépot N°$try_nb."
|
72 |
echo "An error occurs when synchronising the repositories N°$try_nb"
|
73 |
echo "An error occurs when synchronising the repositories N°$try_nb"
|
73 |
if [ $(expr $try_nb) -eq $MIRROR_NBR ]
|
74 |
if [ $(expr $try_nb) -eq $MIRROR_NBR ]
|
74 |
then
|
75 |
then
|