Subversion Repositories ALCASAR

Rev

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

Rev 3093 Rev 3099
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
# $Id: alcasar-uninstall.sh 3093 2022-12-11 23:07:02Z rexy $
2
# $Id: alcasar-uninstall.sh 3099 2022-12-28 11:30:30Z rexy $
3
 
3
 
4
# alcasar-uninstall.sh
4
# alcasar-uninstall.sh
5
# by Franck BOUIJOUX, Pascal LEVANT and Richard REY
5
# by Franck BOUIJOUX, Pascal LEVANT 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 171... Line 171...
171
		rm -f /etc/systemd/system/vnstat.service
171
		rm -f /etc/systemd/system/vnstat.service
172
		echo -n "2"
172
		echo -n "2"
173
	fi
173
	fi
174
}
174
}
175
 
175
 
176
dnsmasq ()
-
 
177
{
-
 
178
	echo -en "(3) : "
-
 
179
	[ -e /etc/dnsmasq.conf.default ] && mv /etc/dnsmasq.conf.default /etc/dnsmasq.conf && echo -n "1, "
-
 
180
	[ -e /etc/dnsmasq-whitelist.conf ] && rm /etc/dnsmasq-whitelist.conf && echo -n "2, "
-
 
181
	if [ -e /etc/systemd/system/dnsmasq-whitelist.service ]; then
-
 
182
		rm -f /etc/systemd/system/dnsmasq-whitelist.service
-
 
183
		echo -n "3, "
-
 
184
	fi
-
 
185
}
-
 
186
 
-
 
187
unbound ()
176
unbound ()
188
{
177
{
189
	echo -en "(9) : "
178
	echo -en "(9) : "
190
	[ -e /etc/unbound/unbound.conf.default ] && mv /etc/unbound/unbound.conf.default /etc/unbound/unbound.conf && echo -n "1, "
179
	[ -e /etc/unbound/unbound.conf.default ] && mv /etc/unbound/unbound.conf.default /etc/unbound/unbound.conf && echo -n "1, "
191
	[ -e /etc/unbound/unbound-blacklist.conf ] && rm -f /etc/unbound/unbound-blacklist.conf && echo -n "2, "
180
	[ -e /etc/unbound/unbound-blacklist.conf ] && rm -f /etc/unbound/unbound-blacklist.conf && echo -n "2, "
Line 325... Line 314...
325
clear
314
clear
326
if [ $mode == "full" ]; then
315
if [ $mode == "full" ]; then
327
	echo "----------------------------------------------------------------------------"
316
	echo "----------------------------------------------------------------------------"
328
	echo "**                     Uninstall/Désinstallation d'ALCASAR		**"
317
	echo "**                     Uninstall/Désinstallation d'ALCASAR		**"
329
	echo "----------------------------------------------------------------------------"
318
	echo "----------------------------------------------------------------------------"
330
	services="vnstat clamav-daemon clamav-freshclam ntpd php-fpm lighttpd radiusd mysqld unbound unbound-blacklist unbound-whitelist dnsmasq-whitelist unbound-blackhole nfcapd fail2ban iptables ulogd-ext-access ulogd-ssh ulogd-traceability e2guardian sshd chilli"
319
	services="vnstat clamav-daemon clamav-freshclam ntpd php-fpm lighttpd radiusd mysqld unbound unbound-blacklist unbound-whitelist unbound-blackhole nfcapd fail2ban iptables ulogd-ext-access ulogd-ssh ulogd-traceability e2guardian sshd chilli"
331
	/usr/local/bin/alcasar-logout.sh all # logout everybody
320
	/usr/local/bin/alcasar-logout.sh all # logout everybody
332
else
321
else
333
	echo "--------------------------------------------------------------------------"
322
	echo "--------------------------------------------------------------------------"
334
	echo "**                     update/mise à jour d'ALCASAR			**"
323
	echo "**                     update/mise à jour d'ALCASAR			**"
335
	echo "--------------------------------------------------------------------------"
324
	echo "--------------------------------------------------------------------------"
336
	# unbound, iptables & sshd should stay on to allow remote update
325
	# unbound, iptables & sshd should stay on to allow remote update
337
	services="vnstat clamav-daemon clamav-freshclam ntpd php-fpm lighttpd radiusd mysqld unbound-blacklist unbound-whitelist dnsmasq-whitelist unbound-blackhole nfcapd fail2ban ulogd-ext-access ulogd-ssh ulogd-traceability e2guardian chilli"
326
	services="vnstat clamav-daemon clamav-freshclam ntpd php-fpm lighttpd radiusd mysqld unbound-blacklist unbound-whitelist unbound-blackhole nfcapd fail2ban ulogd-ext-access ulogd-ssh ulogd-traceability e2guardian chilli"
338
	/usr/local/bin/alcasar-bypass.sh -on # to allow remote update + users stay connected during the update
327
	/usr/local/bin/alcasar-bypass.sh -on # to allow remote update + users stay connected during the update
339
fi
328
fi
340
 
329
 
341
echo "Stopping services : "
330
echo "Stopping services : "
342
# remove daemon watchdog in order to not restart alcasar daemons during the uninstall process
331
# remove daemon watchdog in order to not restart alcasar daemons during the uninstall process
Line 364... Line 353...
364
done
353
done
365
 
354
 
366
[ $mode == "update" ] && /usr/bin/systemctl reload sshd # reload sshd in case of remote update
355
[ $mode == "update" ] && /usr/bin/systemctl reload sshd # reload sshd in case of remote update
367
 
356
 
368
echo "Reset ALCASAR main functions : "
357
echo "Reset ALCASAR main functions : "
369
for func in init ACC CA time_server init_db freeradius chilli e2guardian antivirus ulogd nfsen vnstat unbound dnsmasq dhcpd cron fail2ban gammu_smsd msec letsencrypt mail_service post_install
358
for func in init ACC CA time_server init_db freeradius chilli e2guardian antivirus ulogd nfsen vnstat unbound dhcpd cron fail2ban gammu_smsd msec letsencrypt mail_service post_install
370
do
359
do
371
	echo -en "\n- $func "
360
	echo -en "\n- $func "
372
	$func
361
	$func
373
	if [ $DEBUG_ALCASAR == "on" ]; then
362
	if [ $DEBUG_ALCASAR == "on" ]; then
374
		echo -n " *** 'debug' : end of cleaning '$func' *** "
363
		echo -n " *** 'debug' : end of cleaning '$func' *** "