Subversion Repositories ALCASAR

Rev

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

Rev 1521 Rev 1530
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
# $Id: alcasar-uninstall.sh 1521 2014-12-17 22:57:44Z richard $
2
# $Id: alcasar-uninstall.sh 1530 2014-12-21 19:59:20Z richard $
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 15... Line 15...
15
echo "-----------------------------------------------------------------------------"
15
echo "-----------------------------------------------------------------------------"
16
echo
16
echo
17
#services_stop
17
#services_stop
18
/usr/local/bin/alcasar-sms.sh --stop 
18
/usr/local/bin/alcasar-sms.sh --stop 
19
 
19
 
20
for i in alcasar-load_balancing freshclam ntpd dansguardian httpd radiusd mysqld dnsmasq dnsmasq-blacklist dnsmasq-whitelist dnsmasq-blackhole tinyproxy havp nfsen chilli fail2ban iptables ulogd-ext-access ulogd-ssh ulogd-traceability
20
for i in alcasar-load_balancing freshclam ntpd dansguardian httpd radiusd mysqld dnsmasq dnsmasq-blacklist dnsmasq-whitelist dnsmasq-blackhole tinyproxy havp nfsen chilli fail2ban iptables ulogd-ext-access ulogd-ssh ulogd-traceability vnstat
21
do
21
do
22
	[ -e /lib/systemd/system/$i.service ] && systemctl disable $i.service && systemctl stop $i.service 1>/dev/null
22
	[ -e /lib/systemd/system/$i.service ] && systemctl disable $i.service && systemctl stop $i.service 1>/dev/null
23
done
23
done
24
 
24
 
25
echo "Reset ALCASAR main functions : "
25
echo "Reset ALCASAR main functions : "
Line 29... Line 29...
29
#les fichiers situés dans /usr/local/ seront supprimés à la fin car encore utiles ici
29
#les fichiers situés dans /usr/local/ seront supprimés à la fin car encore utiles ici
30
rm -f /root/ALCASAR* && echo -n "1"
30
rm -f /root/ALCASAR* && echo -n "1"
31
sleep 1
31
sleep 1
32
 
32
 
33
# gestion
33
# gestion
34
echo -en "\n- gestion(9) : "
34
echo -en "\n- gestion(10) : "
35
[ -d /var/www/html ] && rm -rf /var/www/html && echo -n "1, "
35
[ -d /var/www/html ] && rm -rf /var/www/html && echo -n "1, "
36
[ -e /etc/httpd/conf/httpd.conf.default ] && mv /etc/httpd/conf/httpd.conf.default /etc/httpd/conf/httpd.conf && echo -n "2, "
36
[ -e /etc/httpd/conf/httpd.conf.default ] && mv /etc/httpd/conf/httpd.conf.default /etc/httpd/conf/httpd.conf && echo -n "2, "
37
[ -e /etc/php.ini.default ] && mv /etc/php.ini.default /etc/php.ini && echo -n "3, "
37
[ -e /etc/php.ini.default ] && mv /etc/php.ini.default /etc/php.ini && echo -n "3, "
38
[ -e /etc/httpd/conf/vhosts-ssl.default ] && FIC_VIRTUAL_SSL=`find /etc/httpd/conf -type f -name *default_ssl_vhost.conf` && mv /etc/httpd/conf/vhosts-ssl.default $FIC_VIRTUAL_SSL && echo -n "4, "
38
[ -e /etc/httpd/conf/vhosts-ssl.default ] && FIC_VIRTUAL_SSL=`find /etc/httpd/conf -type f -name *default_ssl_vhost.conf` && mv /etc/httpd/conf/vhosts-ssl.default $FIC_VIRTUAL_SSL && echo -n "4, "
39
if [ -d /usr/local/etc/digest ] # v >= 2.0
39
if [ -d /usr/local/etc/digest ] # v >= 2.0
Line 41... Line 41...
41
	else echo -n "5, "
41
	else echo -n "5, "
42
fi
42
fi
43
[ -e /etc/httpd/conf/webapps.d/alcasar.conf ] && rm -f /etc/httpd/conf/webapps.d/alcasar.conf && echo -n "6, "
43
[ -e /etc/httpd/conf/webapps.d/alcasar.conf ] && rm -f /etc/httpd/conf/webapps.d/alcasar.conf && echo -n "6, "
44
[ -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 "7, "
44
[ -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 "7, "
45
[ -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 "8, "
45
[ -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 "8, "
46
[ -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 "9"
46
[ -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 "9, "
-
 
47
[ -e /etc/vnstat.conf.default ] && mv /etc/vnstat.conf.default /etc/vnstat.conf && echo -n "10"
47
sleep 1
48
sleep 1
48
 
49
 
49
# CA
50
# CA
50
echo -en "\n- AC(4) : "
51
echo -en "\n- AC(4) : "
51
[ -e /etc/pki/CA/alcasar-ca.crt ] && rm -f /etc/pki/CA/alcasar-ca.crt && echo -n "1, "
52
[ -e /etc/pki/CA/alcasar-ca.crt ] && rm -f /etc/pki/CA/alcasar-ca.crt && echo -n "1, "
Line 175... Line 176...
175
else echo -n "uninstalled"
176
else echo -n "uninstalled"
176
fi
177
fi
177
sleep 1
178
sleep 1
178
 
179
 
179
#fail2ban
180
#fail2ban
180
echo -en "\n- fail2ban(7) : "
181
echo -en "\n- fail2ban(8) : "
181
[ -e /etc/fail2ban/fail2ban.conf.default ] && mv /etc/fail2ban/fail2ban.conf.default /etc/fail2ban/fail2ban.conf && echo -n "1, "
182
[ -e /etc/fail2ban/fail2ban.conf.default ] && mv /etc/fail2ban/fail2ban.conf.default /etc/fail2ban/fail2ban.conf && echo -n "1, "
182
[ -e /etc/fail2ban/jail.conf.default ] && mv /etc/fail2ban/jail.conf.default /etc/fail2ban/jail.conf && echo -n "2, "
183
[ -e /etc/fail2ban/jail.conf.default ] && mv /etc/fail2ban/jail.conf.default /etc/fail2ban/jail.conf && echo -n "2, "
183
[ -e /etc/fail2ban/action.d/iptables-allports.conf.default ] && mv /etc/fail2ban/action.d/iptables-allports.conf.default /etc/fail2ban/action.d/iptables-allports.conf && echo -n "3, "
184
[ -e /etc/fail2ban/action.d/iptables-allports.conf.default ] && mv /etc/fail2ban/action.d/iptables-allports.conf.default /etc/fail2ban/action.d/iptables-allports.conf && echo -n "3, "
184
[ -e /etc/fail2ban/filter.d/alcasar_mod-evasive.conf ] && rm /etc/fail2ban/filter.d/alcasar_mod-evasive.conf && echo -n "4, "
185
[ -e /etc/fail2ban/filter.d/alcasar_mod-evasive.conf ] && rm /etc/fail2ban/filter.d/alcasar_mod-evasive.conf && echo -n "4, "
185
[ -e /etc/fail2ban/filter.d/alcasar_htdigest.conf ] && rm /etc/fail2ban/filter.d/alcasar_htdigest.conf && echo -n "5, "
186
[ -e /etc/fail2ban/filter.d/alcasar_htdigest.conf ] && rm /etc/fail2ban/filter.d/alcasar_htdigest.conf && echo -n "5, "