Line 1... |
Line 1... |
1 |
#!/bin/bash
|
1 |
#!/bin/bash
|
2 |
# $Id: alcasar-uninstall.sh 3222 2024-07-17 09:56:42Z rexy $
|
2 |
# $Id: alcasar-uninstall.sh 3230 2024-11-06 23:38:15Z 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 20... |
Line 20... |
20 |
[ -e /etc/default/grub.default ] && mv -f /etc/default/grub.default /etc/default/grub && echo -n "3"
|
20 |
[ -e /etc/default/grub.default ] && mv -f /etc/default/grub.default /etc/default/grub && echo -n "3"
|
21 |
}
|
21 |
}
|
22 |
|
22 |
|
23 |
ACC ()
|
23 |
ACC ()
|
24 |
{
|
24 |
{
|
25 |
echo -en "(11) : "
|
25 |
echo -en "(12) : "
|
26 |
[ -d /var/www/html ] && rm -rf /var/www/html && echo -n "1, "
|
26 |
[ -d /var/www/html ] && rm -rf /var/www/html && echo -n "1, "
|
27 |
[ -d /etc/freeradius-web ] && rm -rf /etc/freeradius-web && echo -n "2, "
|
27 |
[ -d /etc/freeradius-web ] && rm -rf /etc/freeradius-web && echo -n "2, "
|
28 |
[ -e /etc/php.d/05_date.ini.default ] && mv -f /etc/php.d/05_date.ini.default /etc/php.d/05_date.ini && echo -n "3, "
|
- |
|
29 |
[ -e /etc/php.ini.default ] && mv -f /etc/php.ini.default /etc/php.ini && echo -n "4, "
|
28 |
[ -e /etc/php.ini.default ] && mv -f /etc/php.ini.default /etc/php.ini && echo -n "4, "
|
- |
|
29 |
[ -d /usr/local/etc/digest ] && rm -rf /usr/local/etc/digest && echo -n "5, "
|
30 |
[ -e /etc/lighttpd/lighttpd.conf.default ] && mv -f /etc/lighttpd/lighttpd.conf.default /etc/lighttpd/lighttpd.conf && echo -n "5, "
|
30 |
[ -e /etc/httpd/conf/httpd.conf.default ] && mv /etc/httpd/conf/httpd.conf.default /etc/httpd/conf/httpd.conf && echo -n "6, "
|
31 |
[ -e /etc/lighttpd/modules.conf.default ] && mv -f /etc/lighttpd/modules.conf.default /etc/lighttpd/modules.conf && echo -n "6, "
|
31 |
[ -e /etc/httpd/conf/modules.d/00_base.conf.default ] && mv /etc/httpd/conf/modules.d/00_base.conf.default /etc/httpd/conf/modules.d/00_base.conf && echo -n "7, "
|
32 |
[ -e /etc/lighttpd/conf.d/fastcgi.conf.default ] && mv -f /etc/lighttpd/conf.d/fastcgi.conf.default /etc/lighttpd/conf.d/fastcgi.conf && echo -n "7, "
|
32 |
[ -e /etc/httpd/conf/conf.d/ssl.conf.default ] && mv /etc/httpd/conf/conf.d/ssl.conf.default /etc/httpd/conf/conf.d/ssl.conf && echo -n "8, "
|
33 |
[ -e /etc/php-fpm.conf.default ] && mv -f /etc/php-fpm.conf.default /etc/php-fpm.conf && echo -n "8, "
|
33 |
[ -e /etc/httpd/conf/conf.d/multilang-errordoc.conf.default ] && mv /etc/httpd/conf/conf.d/multilang-errordoc.conf.default /etc/httpd/conf/conf.d/multilang-errordoc.conf && echo -n "9, "
|
34 |
[ -d /etc/lighttpd/vhosts.d ] && rm -rf /etc/lighttpd/vhosts.d && echo -n "9, "
|
34 |
[ -e /usr/share/httpd/error/include/top.html.default ] && mv /usr/share/httpd/error/include/top.html.default /usr/share/httpd/error/include/top.html && echo -n "10, "
|
35 |
[ -d /usr/local/etc/digest ] && rm -rf /usr/local/etc/digest && echo -n "10, "
|
35 |
[ -e /usr/share/httpd/error/include/bottom.html.default ] && mv /usr/share/httpd/error/include/bottom.html.default /usr/share/httpd/error/include/top.html && echo -n "11, "
|
36 |
[ -e /etc/systemd/system/lighttpd.service ] && rm -f /etc/systemd/system/lighttpd.service && echo -n "11"
|
36 |
[ -e /etc/httpd/conf/webapps.d/alcasar.conf ] && rm -f /etc/httpd/conf/webapps.d/alcasar.conf && echo -n "12"
|
37 |
}
|
37 |
}
|
38 |
|
38 |
|
39 |
CA ()
|
39 |
CA ()
|
40 |
{
|
40 |
{
|
41 |
echo -en "(5) : "
|
41 |
echo -en "(5) : "
|
Line 306... |
Line 306... |
306 |
clear
|
306 |
clear
|
307 |
if [ $mode == "full" ]; then
|
307 |
if [ $mode == "full" ]; then
|
308 |
echo "----------------------------------------------------------------------------"
|
308 |
echo "----------------------------------------------------------------------------"
|
309 |
echo "** Uninstall/Désinstallation d'ALCASAR **"
|
309 |
echo "** Uninstall/Désinstallation d'ALCASAR **"
|
310 |
echo "----------------------------------------------------------------------------"
|
310 |
echo "----------------------------------------------------------------------------"
|
311 |
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"
|
311 |
services="vnstat clamav-daemon clamav-freshclam ntpd httpd radiusd mysqld unbound unbound-blacklist unbound-whitelist unbound-blackhole nfcapd fail2ban iptables ulogd-ext-access ulogd-ssh ulogd-traceability e2guardian sshd chilli"
|
312 |
/usr/local/bin/alcasar-logout.sh all # logout everybody
|
312 |
/usr/local/bin/alcasar-logout.sh all # logout everybody
|
313 |
else
|
313 |
else
|
314 |
echo "--------------------------------------------------------------------------"
|
314 |
echo "--------------------------------------------------------------------------"
|
315 |
echo "** update/mise à jour d'ALCASAR **"
|
315 |
echo "** update/mise à jour d'ALCASAR **"
|
316 |
echo "--------------------------------------------------------------------------"
|
316 |
echo "--------------------------------------------------------------------------"
|
317 |
# unbound, iptables & sshd should stay on to allow remote update
|
317 |
# unbound, iptables & sshd should stay on to allow remote update
|
318 |
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"
|
318 |
services="vnstat clamav-daemon clamav-freshclam ntpd httpd radiusd mysqld unbound-blacklist unbound-whitelist unbound-blackhole nfcapd fail2ban ulogd-ext-access ulogd-ssh ulogd-traceability e2guardian chilli"
|
319 |
/usr/local/bin/alcasar-bypass.sh -on # to allow remote update + users stay connected during the update
|
319 |
/usr/local/bin/alcasar-bypass.sh -on # to allow remote update + users stay connected during the update
|
320 |
fi
|
320 |
fi
|
321 |
|
321 |
|
322 |
echo "Stopping services : "
|
322 |
echo "Stopping services : "
|
323 |
# remove daemon watchdog in order to not restart alcasar daemons during the uninstall process
|
323 |
# remove daemon watchdog in order to not restart alcasar daemons during the uninstall process
|