Subversion Repositories ALCASAR

Rev

Rev 527 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 527 Rev 532
Line 1... Line 1...
1
#!/bin/sh
1
#!/bin/sh
2
# $Id: alcasar-urpmi.sh 527 2011-03-31 21:59:11Z richard $
2
# $Id: alcasar-urpmi.sh 532 2011-04-05 22:17:43Z richard $
3
# script de mise en place des dépots RPM 
3
# script de mise en place des dépots RPM 
4
# 3abtux & rexy
4
# 3abtux & rexy
5
 
5
 
6
VERSION="2010.2"
6
VERSION="2010.2"
7
ARCH="i586" 
7
ARCH="i586" 
-
 
8
# ****** Alcasar needed RPMS - paquetages nécessaires au fonctionnement d'Alcasar ******
-
 
9
PACKAGES="freeradius freeradius-mysql freeradius-ldap freeradius-web apache-mpm-prefork apache-mod_ssl apache-mod_php squid dansguardian postfix MySQL logwatch ntp awstats mondo cdrecord buffer vim-enhanced bind-utils wget arpscan ulogd openssh-server php-xml pam_ccreds rng-utils lsb-release dnsmasq sudo cronie-anacron pciutils clamav pm-fallback-policy"
8
 
10
 
9
rpm_repository_sync ()
11
rpm_repository_sync ()
10
{
12
{
11
echo ${!MIRRORLIST}
13
echo ${!MIRRORLIST}
12
urpmi.removemedia -a
14
urpmi.removemedia -a
13
urpmi.addmedia --wget --probe-synthesis --mirrorlist ${!MIRRORLIST} main /media/main/release
15
urpmi.addmedia --wget --probe-synthesis --mirrorlist ${!MIRRORLIST} main /media/main/release
14
urpmi --auto wget
-
 
15
urpmi.addmedia --wget --update --probe-synthesis --mirrorlist ${!MIRRORLIST} main_updates /media/main/updates
16
urpmi.addmedia --wget --update --probe-synthesis --mirrorlist ${!MIRRORLIST} main_updates /media/main/updates
16
urpmi.addmedia --wget --probe-synthetis --mirrorlist ${!MIRRORLIST} contrib /media/contrib/release
17
urpmi.addmedia --wget --probe-synthesis --mirrorlist ${!MIRRORLIST} contrib /media/contrib/release
17
urpmi.addmedia --wget --update --probe-synthesis --mirrorlist ${!MIRRORLIST} contrib_updates /media/contrib/updates
18
urpmi.addmedia --wget --update --probe-synthesis --mirrorlist ${!MIRRORLIST} contrib_updates /media/contrib/updates
18
}
19
}
19
 
20
 
-
 
21
rpm_error ()
-
 
22
{
-
 
23
echo
-
 
24
echo "Relancez l'installation ultérieurement."
-
 
25
echo "Si vous rencontrez à nouveau ce problème, modifier les variables MIRRORLIST[1&2] du fichier 'scripts/alcasar-urpmi.sh'"
-
 
26
echo "Try an other install later."
-
 
27
echo "If this problem occurs again, change the MIRRORLIST[1&2] variables in the file 'scripts/alcasar-urpmi.sh'"
-
 
28
}
20
# extract the current Mandriva version and hardware architecture (i586 ou X64)
29
# extract the current Mandriva version and hardware architecture (i586 ou X64)
21
fic=`cat /etc/product.id`
30
fic=`cat /etc/product.id`
22
old="$IFS"
31
old="$IFS"
23
IFS=","
32
IFS=","
24
set $fic
33
set $fic
Line 40... Line 49...
40
	then 
49
	then 
41
		ARCH=`echo $i|cut -d"=" -f2`
50
		ARCH=`echo $i|cut -d"=" -f2`
42
	fi
51
	fi
43
done
52
done
44
IFS="$old"
53
IFS="$old"
-
 
54
# We prefer wget than curl
-
 
55
urpmi --no-verify-rpm conf/rpms/$ARCH/wget*.rpm
45
# Set the RPM repository
56
# Set the RPM repository
46
MIRROR_NBR=2
57
MIRROR_NBR=2
47
#                       For french ALCASARistes
58
#                       For french ALCASARistes
48
MIRRORLIST1="http://ftp.free.fr/pub/Distributions_Linux/MandrivaLinux/official/$VERSION/$ARCH"
59
MIRRORLIST1="http://ftp.free.fr/pub/Distributions_Linux/MandrivaLinux/official/$VERSION/$ARCH"
49
#                       For International install
60
#                       For International install
Line 59... Line 70...
59
	then
70
	then
60
		echo "Une erreur a été détectée lors de la synchronisation avec le dépot N°$try_nb."
71
		echo "Une erreur a été détectée lors de la synchronisation avec le dépot N°$try_nb."
61
		echo "An error occurs when synchronising the repositories N°$try_nb"
72
		echo "An error occurs when synchronising the repositories N°$try_nb"
62
		if [ $(expr $try_nb) -eq $MIRROR_NBR ]
73
		if [ $(expr $try_nb) -eq $MIRROR_NBR ]
63
		then
74
		then
64
			echo
75
			rpm_error
65
			echo "Relancez l'installation ultérieurement."
-
 
66
			echo "Si vous rencontrez à nouveau ce problème, modifier les variables MIRRORLIST[1&2] du fichier 'scripts/alcasar-urpmi.sh'"
-
 
67
			echo "Try an other install later."
-
 
68
			echo "If this problem occurs again, change the MIRRORLIST[1&2] variables in the file 'scripts/alcasar-urpmi.sh'"
-
 
69
			exit 1
76
			exit 1
70
		fi
77
		fi
71
		echo "Voulez-vous tenter une synchronisation avec un autre dépôt?"
78
		echo "Voulez-vous tenter une synchronisation avec un autre dépôt?"
72
		echo "Do you wan't to try a synchronisation with an other repository?"
79
		echo "Do you wan't to try a synchronisation with an other repository?"
73
		response=0
80
		response=0
Line 90... Line 97...
90
urpmi --downloader wget --auto --auto-update --quiet --test --retry 2
97
urpmi --downloader wget --auto --auto-update --quiet --test --retry 2
91
if [ "$?" != "0" ]
98
if [ "$?" != "0" ]
92
then
99
then
93
	echo
100
	echo
94
	echo "Une erreur a été détectée lors de la récupération des paquetages."
101
	echo "Une erreur a été détectée lors de la récupération des paquetages."
95
	echo "Relancez l'installation ultérieurement."
-
 
96
	echo "Si vous rencontrez à nouveau ce problème, modifier les variables MIRRORLIST[1&2] du fichier 'scripts/alcasar-urpmi.sh'"
-
 
97
	echo "An error occurs when downloading"
102
	echo "An error occurs when downloading"
98
	echo "Try an other install later."
103
	rpm_error
99
	echo "If this problem occurs again, change the MIRRORLIST[1&2] variables in the file 'scripts/alcasar-urpmi.sh'"
-
 
100
	exit 1
104
	exit 1
101
fi
105
fi
102
# update with cached RPM
106
# update with cached RPM
103
urpmi --auto --auto-update
107
urpmi --auto --auto-update
-
 
108
# Download of ALCASAR specifics RPM in cache (and test)
-
 
109
echo "Récupération des paquetages complémentaires. Veuillez patienter ..."
-
 
110
echo "Download of complementary packages. Please wait ..."
-
 
111
urpmi --downloader=wget --auto $PACKAGES --quiet --test --retry 2
-
 
112
if [ "$?" != "0" ]
-
 
113
then
-
 
114
	echo
-
 
115
	echo "Une erreur a été détectée lors de la récupération des paquetages complémentaires."
-
 
116
	echo "An error occurs when downloading complementary packages"
104
# cleaning
117
	rpm_error
-
 
118
	exit 1
-
 
119
fi
-
 
120
# update with cached RPM
105
urpme --auto --auto-orphans
121
urpmi --auto $PACKAGES 
-
 
122
# On supprime les paquetages inutiles
-
 
123
for rm_rpm in shorewall dhcp-server c-icap-server cyrus-sasl distcache-server avahi mandi radeontool
-
 
124
do
-
 
125
	/usr/sbin/urpme --auto $rm_rpm --auto-orphans 2>/dev/null
-
 
126
	echo -n "."
-
 
127
done
-
 
128
# On installe les RPMs spécifiques à la version
-
 
129
urpmi --no-verify --auto conf/rpms/$ARCH/*.rpm
-
 
130
# On empêche les mises à jour de coova-chilli et freeradius par le biais des dépôts
-
 
131
for rpmskip in coova freeradius 
-
 
132
do
-
 
133
	echo -n "/^$rpmskip/" >> /etc/urpmi/skip.list
-
 
134
done
-
 
135
# Clean the RPM cache
-
 
136
urpmi --clean
106
exit 0
137
exit 0
107
 
138