Subversion Repositories ALCASAR

Rev

Rev 3147 | Rev 3190 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log

Rev 3147 Rev 3170
1
#!/bin/bash
1
#!/bin/bash
2
 
2
 
3
# alcasar-rpm.sh
3
# alcasar-rpm.sh
4
# by 3abtux and Rexy
4
# by 3abtux and Rexy
5
# This script is distributed under the Gnu General Public License (GPL)
5
# This script is distributed under the Gnu General Public License (GPL)
6
 
6
 
7
# script de mise en place des dépots RPM + installation des RPM complémentaires
7
# script de mise en place des dépots RPM + installation des RPM complémentaires
8
# configure the RPM repository + complementary RPM installation
8
# configure the RPM repository + complementary RPM installation
9
 
9
 
10
Lang=`echo $LANG|cut -c 1-2`
10
Lang=`echo $LANG|cut -c 1-2`
11
SED="/bin/sed -i"
11
SED="/bin/sed -i"
12
VERSION="8"
12
VERSION="8"
13
ARCH="x86_64"
13
ARCH="x86_64"
14
# The kernel version we compile netflow for
14
# The kernel version we compile netflow for
15
KERNEL="kernel-server-5.15.126-1.mga8-1-1.mga8"
15
KERNEL="kernel-server-5.15.126-1.mga8-1-1.mga8"
16
# ****** Alcasar needed RPMS - paquetages nécessaires au fonctionnement d'Alcasar ******
16
# ****** Alcasar needed RPMS - paquetages nécessaires au fonctionnement d'Alcasar ******
17
# (old) perl-Socket6 : needed by nfsen
17
# (old) perl-Socket6 : needed by nfsen
18
# "fonts-dejavu-common" & "fonts-ttf-dejavu" : fonts needed by wkhtmltopdf
18
# "fonts-dejavu-common" & "fonts-ttf-dejavu" : fonts needed by wkhtmltopdf
19
# "lsscsi" & nvme-cli" & "php-dom" : needed by phpsysinfo
19
# "lsscsi" & nvme-cli" & "php-dom" : needed by phpsysinfo
20
# "socat" : avoid a warning when run the install script of letsencrypt ("acme.sh")
20
# "socat" : avoid a warning when run the install script of letsencrypt ("acme.sh")
21
# "sudo" : needed after a reinstallation (to be investigated)
21
# "sudo" : needed after a reinstallation (to be investigated)
22
# "clamav" + "clamav-db" : needed because of a lack of mutual dependance
-
 
23
# "postfix" + "cyrus-sasl" + "lib64sasl2-plug-plain" : email registration method
22
# "postfix" + "cyrus-sasl" + "lib64sasl2-plug-plain" : email registration method
24
PACKAGES="vim-enhanced freeradius freeradius-mysql freeradius-ldap lighttpd lighttpd-mod_auth php-fpm php-gd php-ldap php-mysqli php-mbstring php-sockets php-curl php-pdo_sqlite php-cli php-dom php-filter unbound e2guardian postfix mariadb ntp bind-utils openssh-server rng-utils rsync clamav clamav-db clamd fail2ban gnupg2 ulogd ipset usb_modeswitch vnstat dos2unix p7zip msec kernel-userspace-headers kernel-firmware kernel-firmware-nonfree dhcp-server tcpdump fonts-dejavu-common fonts-ttf-dejavu lsscsi nvme-cli sudo socat postfix cyrus-sasl lib64sasl2-plug-plain iftop"
23
PACKAGES="vim-enhanced freeradius freeradius-mysql freeradius-ldap lighttpd lighttpd-mod_auth php-fpm php-gd php-ldap php-mysqli php-mbstring php-sockets php-curl php-pdo_sqlite php-cli php-dom php-filter unbound e2guardian postfix mariadb ntp bind-utils openssh-server rng-utils rsync fail2ban gnupg2 ulogd ipset usb_modeswitch vnstat dos2unix p7zip msec kernel-userspace-headers kernel-firmware kernel-firmware-nonfree dhcp-server tcpdump fonts-dejavu-common fonts-ttf-dejavu lsscsi nvme-cli sudo socat postfix cyrus-sasl lib64sasl2-plug-plain iftop"
25
 
24
 
26
rpm_repository_sync ()
25
rpm_repository_sync ()
27
{
26
{
28
	cat <<EOF > /etc/urpmi/urpmi.cfg
27
	cat <<EOF > /etc/urpmi/urpmi.cfg
29
{
28
{
30
downloader: wget
29
downloader: wget
31
}
30
}
32
EOF
31
EOF
33
	echo ${!MIRRORLIST}
32
	echo ${!MIRRORLIST}
34
	urpmi.addmedia core --probe-synthesis --mirrorlist ${!MIRRORLIST} /media/core/release
33
	urpmi.addmedia core --probe-synthesis --mirrorlist ${!MIRRORLIST} /media/core/release
35
	urpmi.addmedia core-updates --update --probe-synthesis --mirrorlist ${!MIRRORLIST} /media/core/updates
34
	urpmi.addmedia core-updates --update --probe-synthesis --mirrorlist ${!MIRRORLIST} /media/core/updates
36
	urpmi.addmedia nonfree --probe-synthesis --mirrorlist ${!MIRRORLIST} /media/nonfree/release
35
	urpmi.addmedia nonfree --probe-synthesis --mirrorlist ${!MIRRORLIST} /media/nonfree/release
37
	urpmi.addmedia nonfree-updates --update --probe-synthesis --mirrorlist ${!MIRRORLIST} /media/nonfree/updates
36
	urpmi.addmedia nonfree-updates --update --probe-synthesis --mirrorlist ${!MIRRORLIST} /media/nonfree/updates
38
}
37
}
39
 
38
 
40
rpm_error ()
39
rpm_error ()
41
{
40
{
42
	# restore previous rpm conf file & removed RPMs
41
	# restore previous rpm conf file & removed RPMs
43
	[ -e /etc/urpmi/urpmi.cfg.old ] && mv /etc/urpmi/urpmi.cfg.old /etc/urpmi/urpmi.cfg
42
	[ -e /etc/urpmi/urpmi.cfg.old ] && mv /etc/urpmi/urpmi.cfg.old /etc/urpmi/urpmi.cfg
44
	urpmi --no-verify-rpm --auto rpms/$ARCH/wkhtmltopdf*.rpm
43
	urpmi --no-verify-rpm --auto rpms/$ARCH/wkhtmltopdf*.rpm
45
	urpmi --auto --quiet freeradius-ldap lighttpd-mod_auth
44
	urpmi --auto --quiet freeradius-ldap lighttpd-mod_auth
46
	echo
45
	echo
47
	if [ $Lang == "fr" ]
46
	if [ $Lang == "fr" ]
48
	then
47
	then
49
		echo "Relancez l'installation ultérieurement."
48
		echo "Relancez l'installation ultérieurement."
50
		echo "Si vous rencontrez à nouveau ce problème, modifier les variables MIRRORLIST[1&2] du fichier 'scripts/alcasar-rpm.sh'"
49
		echo "Si vous rencontrez à nouveau ce problème, modifier les variables MIRRORLIST[1&2] du fichier 'scripts/alcasar-rpm.sh'"
51
	else
50
	else
52
		echo "Try an other install later."
51
		echo "Try an other install later."
53
		echo "If this problem occurs again, change the MIRRORLIST[1&2] variables in the file 'scripts/alcasar-rpm.sh'"
52
		echo "If this problem occurs again, change the MIRRORLIST[1&2] variables in the file 'scripts/alcasar-rpm.sh'"
54
	fi
53
	fi
55
}
54
}
56
 
55
 
57
# extract the current Mageia version and hardware architecture (i586 ou X64)
56
# extract the current Mageia version and hardware architecture (i586 ou X64)
58
fic=`cat /etc/product.id`
57
fic=`cat /etc/product.id`
59
old="$IFS"
58
old="$IFS"
60
IFS=","
59
IFS=","
61
set $fic
60
set $fic
62
for i in $*
61
for i in $*
63
do
62
do
64
	if [ "`echo $i|grep distribution|cut -d'=' -f1`" == "distribution" ]
63
	if [ "`echo $i|grep distribution|cut -d'=' -f1`" == "distribution" ]
65
	then
64
	then
66
		DISTRIBUTION=`echo $i|cut -d"=" -f2`
65
		DISTRIBUTION=`echo $i|cut -d"=" -f2`
67
	fi
66
	fi
68
	if [ "`echo $i|grep version|cut -d'=' -f1`" == "version" ]
67
	if [ "`echo $i|grep version|cut -d'=' -f1`" == "version" ]
69
	then
68
	then
70
		CURRENT_VERSION=`echo $i|cut -d"=" -f2`
69
		CURRENT_VERSION=`echo $i|cut -d"=" -f2`
71
	fi
70
	fi
72
	if [ "`echo $i|grep arch|cut -d'=' -f1`" == "arch" ]
71
	if [ "`echo $i|grep arch|cut -d'=' -f1`" == "arch" ]
73
	then
72
	then
74
		ARCH=`echo $i|cut -d"=" -f2`
73
		ARCH=`echo $i|cut -d"=" -f2`
75
	fi
74
	fi
76
done
75
done
77
IFS="$old"
76
IFS="$old"
78
 
77
 
79
# We prefer wget than curl
78
# We prefer wget than curl
80
urpmi --no-verify-rpm --auto rpms/$ARCH/wget*.rpm
79
urpmi --no-verify-rpm --auto rpms/$ARCH/wget*.rpm
81
 
80
 
82
# Set the RPM repository (if not already set)
81
# Set the RPM repository (if not already set)
83
cp /etc/urpmi/urpmi.cfg /etc/urpmi/urpmi.cfg.old
82
cp /etc/urpmi/urpmi.cfg /etc/urpmi/urpmi.cfg.old
84
ACTIVE_REPO=`cat /etc/urpmi/urpmi.cfg|grep "mageia.org"|wc -l`
83
ACTIVE_REPO=`cat /etc/urpmi/urpmi.cfg|grep "mageia.org"|wc -l`
85
MIRROR_NBR=3
84
MIRROR_NBR=3
86
#                       For French
85
#                       For French
87
MIRRORLIST1="http://ftp.free.fr/mirrors/mageia.org/distrib/$VERSION/$ARCH"
86
MIRRORLIST1="http://ftp.free.fr/mirrors/mageia.org/distrib/$VERSION/$ARCH"
88
#                       For Europeans
87
#                       For Europeans
89
MIRRORLIST2="https://www.mirrorservice.org/pub/mageia/distrib/$VERSION/$ARCH"
88
MIRRORLIST2="https://www.mirrorservice.org/pub/mageia/distrib/$VERSION/$ARCH"
90
#                       For everybody
89
#                       For everybody
91
MIRRORLIST3="https://mirrors.mageia.org/api/mageia.$VERSION.$ARCH.list"
90
MIRRORLIST3="https://mirrors.mageia.org/api/mageia.$VERSION.$ARCH.list"
92
try_nb="0"; nb_repository="0"
91
try_nb="0"; nb_repository="0"
93
while [ "$nb_repository" != "4" ]
92
while [ "$nb_repository" != "4" ]
94
do
93
do
95
	try_nb=`expr $try_nb + 1`
94
	try_nb=`expr $try_nb + 1`
96
	MIRRORLIST="MIRRORLIST$try_nb"
95
	MIRRORLIST="MIRRORLIST$try_nb"
97
	rpm_repository_sync
96
	rpm_repository_sync
98
	nb_repository=`cat /etc/urpmi/urpmi.cfg|grep mirrorlist|wc -l`
97
	nb_repository=`cat /etc/urpmi/urpmi.cfg|grep mirrorlist|wc -l`
99
	if [ "$nb_repository" != "4" ]
98
	if [ "$nb_repository" != "4" ]
100
	then
99
	then
101
		if [ $Lang == "fr" ]
100
		if [ $Lang == "fr" ]
102
		then
101
		then
103
			echo "Une erreur a été détectée lors de la synchronisation avec le dépot N°$try_nb."
102
			echo "Une erreur a été détectée lors de la synchronisation avec le dépot N°$try_nb."
104
		else
103
		else
105
			echo "An error occurs when synchronising the repositories N°$try_nb"
104
			echo "An error occurs when synchronising the repositories N°$try_nb"
106
		fi
105
		fi
107
		if [ $(expr $try_nb) -eq $MIRROR_NBR ]
106
		if [ $(expr $try_nb) -eq $MIRROR_NBR ]
108
		then
107
		then
109
			rpm_error
108
			rpm_error
110
			exit 1
109
			exit 1
111
		fi
110
		fi
112
		if [ $Lang == "fr" ]
111
		if [ $Lang == "fr" ]
113
		then
112
		then
114
			echo "Voulez-vous tenter une synchronisation avec un autre dépôt ? (O/n)"
113
			echo "Voulez-vous tenter une synchronisation avec un autre dépôt ? (O/n)"
115
		else
114
		else
116
			echo "Do you want to try a synchronisation with an other repository? (Y/n)"
115
			echo "Do you want to try a synchronisation with an other repository? (Y/n)"
117
		fi
116
		fi
118
		response=0
117
		response=0
119
		PTN='^[oOnNyY]?$'
118
		PTN='^[oOnNyY]?$'
120
		until [[ "$response" =~ $PTN ]]
119
		until [[ "$response" =~ $PTN ]]
121
		do
120
		do
122
			read response
121
			read response
123
		done
122
		done
124
		if [ "$response" = "n" ] || [ "$response" = "N" ]
123
		if [ "$response" = "n" ] || [ "$response" = "N" ]
125
		then
124
		then
126
			[ -e /etc/urpmi/urpmi.cfg.old ] && mv /etc/urpmi/urpmi.cfg.old /etc/urpmi/urpmi.cfg # restore previous rpm conf file
125
			[ -e /etc/urpmi/urpmi.cfg.old ] && mv /etc/urpmi/urpmi.cfg.old /etc/urpmi/urpmi.cfg # restore previous rpm conf file
127
			exit 1
126
			exit 1
128
		fi
127
		fi
129
	fi
128
	fi
130
done
129
done
131
 
130
 
132
# At this time, we only skip Kernel update
131
# At this time, we only skip Kernel update
133
echo "/^kernel/" > /etc/urpmi/skip.list
132
echo "/^kernel/" > /etc/urpmi/skip.list
134
if [ `egrep '^exclude=' /etc/dnf/dnf.conf |wc -l` -eq "1" ]; then
133
if [ `egrep '^exclude=' /etc/dnf/dnf.conf |wc -l` -eq "1" ]; then
135
	$SED "s?^exclude=.*?exclude=kernel\*?g" /etc/dnf/dnf.conf
134
	$SED "s?^exclude=.*?exclude=kernel\*?g" /etc/dnf/dnf.conf
136
else
135
else
137
	echo "exclude=kernel*" >> /etc/dnf/dnf.conf
136
	echo "exclude=kernel*" >> /etc/dnf/dnf.conf
138
fi
137
fi
139
 
138
 
140
# Remove some RPMs in order to avoid error and automatic update
139
# Remove some RPMs in order to avoid error and automatic update
141
urpme wkhtmltopdf freeradius-ldap lighttpd-mod_auth
140
urpme wkhtmltopdf freeradius-ldap lighttpd-mod_auth
142
 
141
 
143
# download the kernel used by ALCASAR
142
# download the kernel used by ALCASAR
144
if [ $Lang == "fr" ]
143
if [ $Lang == "fr" ]
145
then
144
then
146
	echo "Récupération du noyau Linux exploité par ALCASAR. Veuillez patienter ..."
145
	echo "Récupération du noyau Linux exploité par ALCASAR. Veuillez patienter ..."
147
else
146
else
148
	echo "Download the Linux kernel used by ALCASAR. Please wait ..."
147
	echo "Download the Linux kernel used by ALCASAR. Please wait ..."
149
fi
148
fi
150
urpmi --auto --quiet $KERNEL
149
urpmi --auto --quiet $KERNEL
151
 
150
 
152
# download updated RPM in cache
151
# download updated RPM in cache
153
if [ $Lang == "fr" ]
152
if [ $Lang == "fr" ]
154
then
153
then
155
	echo "Récupération des paquetages de mise à jour. Veuillez patienter ..."
154
	echo "Récupération des paquetages de mise à jour. Veuillez patienter ..."
156
	echo "Il est temps d'aller prendre un café (ou une bonne bière) ;-)"
155
	echo "Il est temps d'aller prendre un café (ou une bonne bière) ;-)"
157
else
156
else
158
	echo "Updated RPM download. Please wait ..."
157
	echo "Updated RPM download. Please wait ..."
159
	echo "You should now take a coffe (or a good beer) ;-)"
158
	echo "You should now take a coffe (or a good beer) ;-)"
160
fi
159
fi
161
urpmi --auto --auto-update --quiet --test --retry 2
160
urpmi --auto --auto-update --quiet --test --retry 2
162
if [ "$?" != "0" ]
161
if [ "$?" != "0" ]
163
then
162
then
164
	echo
163
	echo
165
	if [ $Lang == "fr" ]
164
	if [ $Lang == "fr" ]
166
	then
165
	then
167
		echo "Une erreur a été détectée lors de la récupération des paquetages."
166
		echo "Une erreur a été détectée lors de la récupération des paquetages."
168
	else
167
	else
169
		echo "An error occurs when downloading RPMS"
168
		echo "An error occurs when downloading RPMS"
170
	fi
169
	fi
171
	rpm_error
170
	rpm_error
172
	exit 1
171
	exit 1
173
fi
172
fi
174
 
173
 
175
# update with cached RPM
174
# update with cached RPM
176
urpmi --auto --auto-update
175
urpmi --auto --auto-update
177
if [ "$?" != "0" ]
176
if [ "$?" != "0" ]
178
then
177
then
179
	echo
178
	echo
180
	if [ $Lang == "fr" ]
179
	if [ $Lang == "fr" ]
181
	then
180
	then
182
		echo "Une erreur a été détectée lors de la mise à jour des paquetages."
181
		echo "Une erreur a été détectée lors de la mise à jour des paquetages."
183
	else
182
	else
184
		echo "An error occurs when updating packages"
183
		echo "An error occurs when updating packages"
185
	fi
184
	fi
186
	rpm_error
185
	rpm_error
187
	exit 1
186
	exit 1
188
fi
187
fi
189
# Clean the RPM cache
188
# Clean the RPM cache
190
urpmi --clean
189
urpmi --clean
191
 
190
 
192
# Download of ALCASAR specifics RPM in cache (and test)
191
# Download of ALCASAR specifics RPM in cache (and test)
193
if [ $Lang == "fr" ]
192
if [ $Lang == "fr" ]
194
then
193
then
195
	echo "Récupération des paquetages complémentaires. Veuillez patienter ..."
194
	echo "Récupération des paquetages complémentaires. Veuillez patienter ..."
196
else
195
else
197
	echo "Download of complementary packages. Please wait ..."
196
	echo "Download of complementary packages. Please wait ..."
198
fi
197
fi
199
urpmi --auto --no-recommends $PACKAGES --quiet --test --retry 2
198
urpmi --auto --no-recommends $PACKAGES --quiet --test --retry 2
200
if [ "$?" != "0" ]
199
if [ "$?" != "0" ]
201
then
200
then
202
	echo
201
	echo
203
	if [ $Lang == "fr" ]
202
	if [ $Lang == "fr" ]
204
	then
203
	then
205
		echo "Une erreur a été détectée lors de la récupération des paquetages complémentaires."
204
		echo "Une erreur a été détectée lors de la récupération des paquetages complémentaires."
206
	else
205
	else
207
		echo "An error occurs when downloading complementary packages"
206
		echo "An error occurs when downloading complementary packages"
208
	fi
207
	fi
209
	rpm_error
208
	rpm_error
210
	exit 1
209
	exit 1
211
fi
210
fi
212
 
211
 
213
# update with cached RPM
212
# update with cached RPM
214
urpmi --auto --no-recommends $PACKAGES
213
urpmi --auto --no-recommends $PACKAGES
215
if [ "$?" != "0" ]
214
if [ "$?" != "0" ]
216
then
215
then
217
	echo
216
	echo
218
	if [ $Lang == "fr" ]
217
	if [ $Lang == "fr" ]
219
	then
218
	then
220
		echo "Une erreur a été détectée lors de l'installation des paquetages complémentaires."
219
		echo "Une erreur a été détectée lors de l'installation des paquetages complémentaires."
221
	else
220
	else
222
		echo "An error occurs when installing complementary packages"
221
		echo "An error occurs when installing complementary packages"
223
	fi
222
	fi
224
	rpm_error
223
	rpm_error
225
	exit 1
224
	exit 1
226
fi
225
fi
227
 
226
 
228
# Keep only the kernel version we compil netflow with, and remove all others
227
# Keep only the kernel version we compil netflow with, and remove all others
229
kernelVersion=$(rpm -qa | grep -e ^kernel-server -e ^kernel-desktop)
228
kernelVersion=$(rpm -qa | grep -e ^kernel-server -e ^kernel-desktop)
230
for i in $kernelVersion
229
for i in $kernelVersion
231
do
230
do
232
	if [ $i != $KERNEL ];then
231
	if [ $i != $KERNEL ];then
233
		urpme --auto $i
232
		urpme --auto $i
234
	fi
233
	fi
235
done
234
done
236
 
235
 
237
# delete unused RPMs
236
# delete unused RPMs
238
if [ $Lang == "fr" ]
237
if [ $Lang == "fr" ]
239
then
238
then
240
	echo "Cleaning the system : "
239
	echo "Cleaning the system : "
241
else
240
else
242
	echo "Nettoyage du système : "
241
	echo "Nettoyage du système : "
243
fi
242
fi
244
unused_rpm="shorewall mandi plymouth squid polkit pm-utils dnsmasq"
243
unused_rpm="shorewall mandi plymouth squid polkit pm-utils dnsmasq clamav clamd clamav-db"
245
/usr/sbin/urpme --auto -a $unused_rpm
244
/usr/sbin/urpme --auto -a $unused_rpm
246
for rpm in `rpm -qa|grep mga7`; do urpme --auto $rpm; done
245
for rpm in `rpm -qa|grep mga7`; do urpme --auto $rpm; done
247
/usr/sbin/urpme --auto --auto-orphans
246
/usr/sbin/urpme --auto --auto-orphans
248
 
247
 
249
# Save chilli launch script (erase with new rpm one)
248
# Save chilli launch script (erase with new rpm one)
250
[ -e /etc/chilli.conf ] && cp /etc/chilli.conf /tmp/
249
[ -e /etc/chilli.conf ] && cp /etc/chilli.conf /tmp/
251
# Install home made RPMs
250
# Install home made RPMs
252
for pkg in `ls rpms/$ARCH/*.rpm`
251
for pkg in `ls rpms/$ARCH/*.rpm`
253
do
252
do
254
    urpmi --no-verify --auto $pkg
253
    urpmi --no-verify --auto $pkg
255
done
254
done
256
# restore chilli launch script
255
# restore chilli launch script
257
[ -e /tmp/chilli.conf ] && mv /tmp/chilli.conf /etc/
256
[ -e /tmp/chilli.conf ] && mv /tmp/chilli.conf /etc/
258
 
257
 
259
# Clean the RPM cache
258
# Clean the RPM cache
260
urpmi --clean
259
urpmi --clean
261
# the ipt-netflow RPM add the kernel module ipt_NETFLOW (the modules dependance tree need to be updated). "2>/dev/null" in order not to display a error (the running kernel is not the ALCASAR one during the installation process)
260
# the ipt-netflow RPM add the kernel module ipt_NETFLOW (the modules dependance tree need to be updated). "2>/dev/null" in order not to display a error (the running kernel is not the ALCASAR one during the installation process)
262
/sbin/depmod -a 2>/dev/null
261
/sbin/depmod -a 2>/dev/null
263
# test if all needed rpms are correctly installed
262
# test if all needed rpms are correctly installed
264
count_pkg=0; nb_pkg=0;
263
count_pkg=0; nb_pkg=0;
265
for pkg in $PACKAGES
264
for pkg in $PACKAGES
266
do
265
do
267
	nb_pkg=`expr $nb_pkg + 1`
266
	nb_pkg=`expr $nb_pkg + 1`
268
	if rpm -q --quiet $pkg ; then
267
	if rpm -q --quiet $pkg ; then
269
		count_pkg=`expr $count_pkg + 1`
268
		count_pkg=`expr $count_pkg + 1`
270
	else
269
	else
271
		echo "error installing $pkg"
270
		echo "error installing $pkg"
272
	fi
271
	fi
273
done
272
done
274
if [ $count_pkg -ne $nb_pkg ]
273
if [ $count_pkg -ne $nb_pkg ]
275
then
274
then
276
	exit 1
275
	exit 1
277
fi
276
fi
278
 
277
 
279
# test if all custom rpms are correctly installed
278
# test if all custom rpms are correctly installed
280
count_pkg=0; nb_pkg=0;
279
count_pkg=0; nb_pkg=0;
281
for pkg in `ls rpms/$ARCH/|sed 's/.x86_64.rpm//'`
280
for pkg in `ls rpms/$ARCH/|sed 's/.x86_64.rpm//'`
282
do
281
do
283
	nb_pkg=`expr $nb_pkg + 1`
282
	nb_pkg=`expr $nb_pkg + 1`
284
	if rpm -q --quiet $pkg ; then
283
	if rpm -q --quiet $pkg ; then
285
		count_pkg=`expr $count_pkg + 1`
284
		count_pkg=`expr $count_pkg + 1`
286
	else
285
	else
287
		echo "error installing $pkg"
286
		echo "error installing $pkg"
288
	fi
287
	fi
289
done
288
done
290
if [ $count_pkg -ne $nb_pkg ]
289
if [ $count_pkg -ne $nb_pkg ]
291
then
290
then
292
	exit 1
291
	exit 1
293
fi
292
fi
294
 
293
 
295
# .rpmnew handling (unused with ALCASAR)
294
# .rpmnew handling (unused with ALCASAR)
296
[ -e /etc/shadow.rpmnew ] && rm -f /etc/shadow.rpmnew
295
[ -e /etc/shadow.rpmnew ] && rm -f /etc/shadow.rpmnew
297
[ -e /etc/sysconfig/system.rpmnew ] && rm -f /etc/sysconfig/system.rpmnew
296
[ -e /etc/sysconfig/system.rpmnew ] && rm -f /etc/sysconfig/system.rpmnew
298
[ -e /etc/rpm/macros.rpmnew ] && rm -f /etc/rpm/macros.rpmnew
297
[ -e /etc/rpm/macros.rpmnew ] && rm -f /etc/rpm/macros.rpmnew
299
[ -e /etc/fstab.rpmnew ] && rm -f /etc/fstab.rpmnew
298
[ -e /etc/fstab.rpmnew ] && rm -f /etc/fstab.rpmnew
300
[ -e /etc/shells.rpmnew ] && rm -f /etc/shells.rpmnew
299
[ -e /etc/shells.rpmnew ] && rm -f /etc/shells.rpmnew
301
[ -e /etc/hosts.rpmnew ] && rm -f /etc/hosts.rpmnew
300
[ -e /etc/hosts.rpmnew ] && rm -f /etc/hosts.rpmnew
302
[ -e /etc/systemd/journald.conf.rpmnew ] && rm -f /etc/systemd/journald.conf.rpmnew
301
[ -e /etc/systemd/journald.conf.rpmnew ] && rm -f /etc/systemd/journald.conf.rpmnew
303
[ -e /etc/raddb/certs/dh.rpmnew ] && rm -f /etc/raddb/certs/dh.rpmnew
302
[ -e /etc/raddb/certs/dh.rpmnew ] && rm -f /etc/raddb/certs/dh.rpmnew
304
 
303
 
305
# .rpmnew handling (used with ALCASAR)
304
# .rpmnew handling (used with ALCASAR)
306
[ -e /etc/php.ini.rpmnew ] && mv -f /etc/php.ini.rpmnew /etc/php.ini.default
305
[ -e /etc/php.ini.rpmnew ] && mv -f /etc/php.ini.rpmnew /etc/php.ini.default
307
[ -e /etc/lighttpd/lighttpd.conf.rpmnew ] && mv -f /etc/lighttpd/lighttpd.conf.rpmnew /etc/lighttpd/lighttpd.conf.default
306
[ -e /etc/lighttpd/lighttpd.conf.rpmnew ] && mv -f /etc/lighttpd/lighttpd.conf.rpmnew /etc/lighttpd/lighttpd.conf.default
308
[ -e /etc/lighttpd/modules.conf.rpmnew ] && mv -f /etc/lighttpd/modules.conf.rpmnew /etc/lighttpd/modules.conf.default
307
[ -e /etc/lighttpd/modules.conf.rpmnew ] && mv -f /etc/lighttpd/modules.conf.rpmnew /etc/lighttpd/modules.conf.default
309
[ -e /etc/e2guardian/e2guardian.conf.rpmnew ] && mv -f /etc/e2guardian/e2guardian.conf.rpmnew /etc/e2guardian/e2guardian.conf.default
308
[ -e /etc/e2guardian/e2guardian.conf.rpmnew ] && mv -f /etc/e2guardian/e2guardian.conf.rpmnew /etc/e2guardian/e2guardian.conf.default
310
[ -e /etc/e2guardian/e2guardianf1.conf.rpmnew ] && mv -f /etc/e2guardian/e2guardianf1.conf.rpmnew /etc/e2guardian/e2guardianf1.conf.default
309
[ -e /etc/e2guardian/e2guardianf1.conf.rpmnew ] && mv -f /etc/e2guardian/e2guardianf1.conf.rpmnew /etc/e2guardian/e2guardianf1.conf.default
311
[ -e /etc/e2guardian/lists/urlregexplist.rpmnew ] && mv -f /etc/e2guardian/lists/urlregexplist.rpmnew /etc/e2guardian/lists/urlregexplist.default
310
[ -e /etc/e2guardian/lists/urlregexplist.rpmnew ] && mv -f /etc/e2guardian/lists/urlregexplist.rpmnew /etc/e2guardian/lists/urlregexplist.default
312
[ -e /etc/e2guardian/lists/bannedregexpurllist.rpmnew ] && mv -f /etc/e2guardian/lists/bannedregexpurllist.rpmnew /etc/e2guardian/lists/bannedregexpurllist.default
311
[ -e /etc/e2guardian/lists/bannedregexpurllist.rpmnew ] && mv -f /etc/e2guardian/lists/bannedregexpurllist.rpmnew /etc/e2guardian/lists/bannedregexpurllist.default
313
[ -e /etc/clamd.conf.rpmnew ] && mv -f /etc/clamd.conf.rpmnew /etc/clamd.conf.default
-
 
314
[ -e /etc/freshclam.conf.rpmnew ] && mv -f /etc/freshclam.conf.rpmnew /etc/freshclam.conf.default
-
 
315
[ -e /etc/vnstat.conf.rpmnew ] && mv -f /etc/vnstat.conf.rpmnew /etc/vnstat.conf.default
312
[ -e /etc/vnstat.conf.rpmnew ] && mv -f /etc/vnstat.conf.rpmnew /etc/vnstat.conf.default
316
[ -e /etc/fail2ban/jail.conf.rpmnew ] && mv -f /etc/fail2ban/jail.conf.rpmnew /etc/fail2ban/jail.conf.default
313
[ -e /etc/fail2ban/jail.conf.rpmnew ] && mv -f /etc/fail2ban/jail.conf.rpmnew /etc/fail2ban/jail.conf.default
317
[ -e /etc/ssh/sshd_config.rpmnew ] && mv -f /etc/ssh/sshd_config.rpmnew /etc/ssh/sshd_config.default
314
[ -e /etc/ssh/sshd_config.rpmnew ] && mv -f /etc/ssh/sshd_config.rpmnew /etc/ssh/sshd_config.default
318
 
315
 
319
exit 0
316
exit 0
320
 
317