Subversion Repositories ALCASAR

Rev

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

Rev 1164 Rev 1207
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
# $Id: alcasar-urpmi.sh 1164 2013-08-16 08:39:19Z crox53 $
2
# $Id: alcasar-urpmi.sh 1207 2013-09-14 16:21:46Z richard $
3
 
3
 
4
# alcasar-urpmi.sh
4
# alcasar-urpmi.sh
5
# by 3abtux and Rexy
5
# by 3abtux and Rexy
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
# configure the RPM repository
9
# configure the RPM repository
10
 
10
 
11
Lang=`echo $LANG|cut -c 1-2`
11
Lang=`echo $LANG|cut -c 1-2`
12
VERSION="2"
12
VERSION="2"
13
ARCH="i586" 
13
ARCH="i586" 
-
 
14
# The kernel version we compile netflow for
-
 
15
KERNEL="kernel-desktop-3.4.45-1.mga2-1-1.mga2"
14
# ****** Alcasar needed RPMS - paquetages nécessaires au fonctionnement d'Alcasar ******
16
# ****** Alcasar needed RPMS - paquetages nécessaires au fonctionnement d'Alcasar ******
15
PACKAGES="sudo freeradius freeradius-mysql freeradius-ldap freeradius-web apache-mpm-prefork apache-mod_ssl apache-mod_php iptables squid dansguardian postfix mariadb logwatch ntp bind-utils openssh-server php-xml php-ldap php-mysql pam_ccreds rng-utils dnsmasq syslinux rsync cronie-anacron clamav pm-fallback-policy php-mbstring perl-rrdtool perl-MailTools perl-Socket6 php-sockets kernel-desktop-3.4.45-1.mga2-1-1.mga2 fail2ban"
17
PACKAGES="sudo freeradius freeradius-mysql freeradius-ldap freeradius-web apache-mpm-prefork apache-mod_ssl apache-mod_php iptables squid dansguardian postfix mariadb logwatch ntp bind-utils openssh-server php-xml php-ldap php-mysql pam_ccreds rng-utils dnsmasq syslinux rsync cronie-anacron clamav pm-fallback-policy php-mbstring perl-rrdtool perl-MailTools perl-Socket6 php-sockets fail2ban"
-
 
18
 
16
rpm_repository_sync ()
19
rpm_repository_sync ()
17
{
20
{
18
cat <<EOF > /etc/urpmi/urpmi.cfg
21
cat <<EOF > /etc/urpmi/urpmi.cfg
19
{
22
{
20
downloader: wget
23
downloader: wget
Line 133... Line 136...
133
			exit 1
136
			exit 1
134
		fi
137
		fi
135
	fi
138
	fi
136
done
139
done
137
# delete unused RPMs
140
# delete unused RPMs
-
 
141
if [ $Lang == "fr" ]
-
 
142
then
138
echo "Cleaning the system : "
143
	echo "Cleaning the system : "
-
 
144
else
-
 
145
	echo "Nettoyage du système : "
-
 
146
fi
139
for rm_rpm in shorewall mandi radeontool avahi
147
for rm_rpm in shorewall mandi radeontool avahi
140
do
148
do
141
	/usr/sbin/urpme --auto $rm_rpm --auto-orphans 2>/dev/null
149
	/usr/sbin/urpme --auto $rm_rpm --auto-orphans 2>/dev/null
142
	echo -n "."
150
	echo -n "."
143
done
151
done
-
 
152
# download the kernel used by ALCASAR and fix its version
-
 
153
if [ $Lang == "fr" ]
-
 
154
then	
-
 
155
	echo "Récupération du noyau Linux exploité par ALCASAR. Veuillez patienter ..."
144
echo
156
else
-
 
157
	echo "Download the Linux kernel used by ALCASAR. Please wait ..."
-
 
158
fi
-
 
159
urpmi --auto --quiet $KERNEL
-
 
160
echo "/^kernel/" > /etc/urpmi/skip.list
145
# download RPM in cache 
161
# download updated RPM in cache 
146
if [ $Lang == "fr" ]
162
if [ $Lang == "fr" ]
147
then	
163
then	
148
	echo "Récupération des paquetages de mise à jour. Veuillez patienter ..."
164
	echo "Récupération des paquetages de mise à jour. Veuillez patienter ..."
149
	echo "Il est temps d'aller prendre un café (ou une bonne bière) ;-)"
165
	echo "Il est temps d'aller prendre un café (ou une bonne bière) ;-)"
150
else
166
else
Line 212... Line 228...
212
		echo "An error occurs when installing complementary packages"
228
		echo "An error occurs when installing complementary packages"
213
	fi
229
	fi
214
	rpm_error
230
	rpm_error
215
	exit 1
231
	exit 1
216
fi
232
fi
-
 
233
# Keep only the kernel version we compil netflow with, and remove all others
-
 
234
kernelVersion=$(rpm -qa | grep "kernel-desktop")
-
 
235
for i in $kernelVersion
-
 
236
do
-
 
237
	if [ ! $i = $KERNEL ];then
-
 
238
		urpme --auto $i
-
 
239
	fi
-
 
240
done
217
# delete old alcasar RPMs and unused services
241
# delete old alcasar RPMs and unused services
218
for rm_rpm in c-icap-server lib64chilli0 libchilli0 python-coova-chilli cyrus-sasl mageia-gfxboot-theme
242
for rm_rpm in c-icap-server lib64chilli0 libchilli0 python-coova-chilli cyrus-sasl mageia-gfxboot-theme
219
do
243
do
220
	/usr/sbin/urpme --auto $rm_rpm --auto-orphans 2>/dev/null
244
	/usr/sbin/urpme --auto $rm_rpm --auto-orphans 2>/dev/null
221
done
245
done
-
 
246
 
222
# Save chilli launch script (erase with new rpm one)
247
# Save chilli launch script (erase with new rpm one)
223
[ -e /etc/chilli.conf ] && cp /etc/chilli.conf /tmp/
248
[ -e /etc/chilli.conf ] && cp /etc/chilli.conf /tmp/
224
# Install home made RPMs
249
# Install home made RPMs
225
urpmi --no-verify --auto conf/rpms/$ARCH/*.rpm
250
urpmi --no-verify --auto conf/rpms/$ARCH/*.rpm
226
# restore chilli launch script
251
# restore chilli launch script
227
[ -e /tmp/chilli.conf ] && mv /tmp/chilli.conf /etc/
252
[ -e /tmp/chilli.conf ] && mv /tmp/chilli.conf /etc/
228
# Clean the RPM cache
253
# Clean the RPM cache
229
urpmi --clean
254
urpmi --clean
230
 
255
 
231
#Keep only kernel-desktop-3.4.45-1.mga2-1-1.mga2 version, and remove all others
-
 
232
kernelVersion=$(rpm -qa | grep "kernel-desktop")
-
 
233
for i in $kernelVersion
-
 
234
do
-
 
235
	if [ ! $i = "kernel-desktop-3.4.45-1.mga2-1-1.mga2" ];then
-
 
236
		urpme $i
-
 
237
	fi
-
 
238
done
-
 
239
 
-
 
240
#Fix the kernel version to : kernel-desktop-3.4.45-1.mga2-1-1.mga2
-
 
241
	echo "/^kernel-desktop/" > /etc/urpmi/skip.list 
-
 
242
 
-
 
243
#update tht kernel modules list
-
 
244
depmod -a
-
 
245
 
-
 
246
exit 0
256
exit 0