Subversion Repositories ALCASAR

Rev

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

Rev 2470 Rev 2488
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
# $Id: alcasar-uninstall.sh 2470 2017-12-27 18:46:44Z richard $
2
# $Id: alcasar-uninstall.sh 2488 2018-02-25 14:53:54Z lucas.echard $
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 18... Line 18...
18
        [ -e /root/grub.default ] && mv -f /root/grub.default /etc/grub.d/10_linux && echo -n "3"
18
        [ -e /root/grub.default ] && mv -f /root/grub.default /etc/grub.d/10_linux && echo -n "3"
19
}
19
}
20
 
20
 
21
ACC ()
21
ACC ()
22
{
22
{
23
        echo -en "(11) : "
23
        echo -en "(7) : "
24
        [ -d /var/www/html ] && rm -rf /var/www/html && echo -n "1, "
24
        [ -d /var/www/html ] && rm -rf /var/www/html && echo -n "1, "
25
        [ -d /etc/freeradius-web ] && rm -rf /etc/freeradius-webl && echo -n "2, "
25
        [ -d /etc/freeradius-web ] && rm -rf /etc/freeradius-webl && echo -n "2, "
26
        [ -e /etc/php.ini.default ] && mv -f /etc/php.ini.default /etc/php.ini && echo -n "3, "
26
        [ -e /etc/php.ini.default ] && mv -f /etc/php.ini.default /etc/php.ini && echo -n "3, "
-
 
27
        [ -e /etc/lighttpd/lighttpd.conf.default ] && mv /etc/lighttpd/lighttpd.conf.default /etc/lighttpd/lighttpd.conf && echo -n "4, "
-
 
28
        [ -e /etc/lighttpd/modules.conf.default ] && mv /etc/lighttpd/modules.conf.default /etc/lighttpd/modules.conf && echo -n "5, "
-
 
29
        [ -e /etc/lighttpd/conf.d/fastcgi.conf.default ] && mv /etc/lighttpd/conf.d/fastcgi.conf.default /etc/lighttpd/conf.d/fastcgi.conf && echo -n "6, "
-
 
30
        [ -d /usr/local/etc/digest ] && rm -rf /usr/local/etc/digest && echo -n "7, "
-
 
31
        [ -e /etc/lighttpd/vhosts.d/alcasar.conf ] && rm -f /etc/lighttpd/vhosts.d/alcasar.conf && echo -n "8"
-
 
32
       
-
 
33
        # Removing old Apache configuration
27
        [ -e /etc/httpd/conf/httpd.conf.default ] && mv /etc/httpd/conf/httpd.conf.default /etc/httpd/conf/httpd.conf && echo -n "4, "
34
        [ -e /etc/httpd/conf/httpd.conf.default ] && mv /etc/httpd/conf/httpd.conf.default /etc/httpd/conf/httpd.conf
28
        [ -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 "5, "
35
        [ -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
29
        [ -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 "6, "
36
        [ -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
30
        [ -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 "7, "
37
        [ -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
31
        [ -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, "
38
        [ -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
32
        [ -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, "
39
        [ -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
33
        [ -d /usr/local/etc/digest ] && rm -rf /usr/local/etc/digest && echo -n "10, "
-
 
34
        [ -e /etc/httpd/conf/webapps.d/alcasar.conf ] && rm -f /etc/httpd/conf/webapps.d/alcasar.conf && echo -n "11"
40
        [ -e /etc/httpd/conf/webapps.d/alcasar.conf ] && rm -f /etc/httpd/conf/webapps.d/alcasar.conf
35
}
41
}
36
 
42
 
37
CA ()
43
CA ()
38
{
44
{
39
        echo -en "(5) : "
45
        echo -en "(5) : "
40
        [ -e /etc/pki/CA/alcasar-ca.crt ] && rm -f /etc/pki/CA/alcasar-ca.crt && echo -n "1, "
46
        [ -e /etc/pki/CA/alcasar-ca.crt ] && rm -f /etc/pki/CA/alcasar-ca.crt && echo -n "1, "
41
        [ -e /etc/pki/CA/private/alcasar-ca.key ] && rm -f /etc/pki/CA/private/alcasar-ca.key && echo -n "2, "
47
        [ -e /etc/pki/CA/private/alcasar-ca.key ] && rm -f /etc/pki/CA/private/alcasar-ca.key && echo -n "2, "
42
        [ -e /etc/pki/tls/certs/alcasar.crt ] && rm -f /etc/pki/tls/certs/alcasar.crt && echo -n "3, "
48
        [ -e /etc/pki/tls/certs/alcasar.crt ] && rm -f /etc/pki/tls/certs/alcasar.crt && echo -n "3, "
43
        [ -e /etc/pki/tls/private/alcasar.key ] && rm -f /etc/pki/tls/private/alcasar.key && echo -n "4, "
49
        [ -e /etc/pki/tls/private/alcasar.key ] && rm -f /etc/pki/tls/private/alcasar.key && echo -n "4, "
-
 
50
        [ -e /etc/pki/tls/private/alcasar.pem ] && rm -f /etc/pki/tls/private/alcasar.pem && echo -n "5"
-
 
51
       
-
 
52
        # Removing old Apache configuration
44
        [ -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 "5"
53
        [ -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
45
}
54
}
46
 
55
 
47
time_server ()
56
time_server ()
48
{
57
{
49
        echo -en "(2) : "
58
        echo -en "(2) : "
Line 272... Line 281...
272
if [ $mode == "full" ]
281
if [ $mode == "full" ]
273
then
282
then
274
        echo "----------------------------------------------------------------------------"
283
        echo "----------------------------------------------------------------------------"
275
        echo "**                     Uninstall/Désinstallation d'ALCASAR               **"
284
        echo "**                     Uninstall/Désinstallation d'ALCASAR               **"
276
        echo "----------------------------------------------------------------------------"
285
        echo "----------------------------------------------------------------------------"
277
        services="alcasar-load_balancing vnstat havp freshclam ntpd httpd radiusd mysqld dnsmasq-blacklist dnsmasq-whitelist dnsmasq-blackhole tinyproxy nfsen fail2ban iptables ulogd-ext-access ulogd-ssh ulogd-traceability dansguardian dnsmasq sshd chilli"
286
        services="alcasar-load_balancing vnstat havp freshclam ntpd lighttpd radiusd mysqld dnsmasq-blacklist dnsmasq-whitelist dnsmasq-blackhole tinyproxy nfsen fail2ban iptables ulogd-ext-access ulogd-ssh ulogd-traceability dansguardian dnsmasq sshd chilli"
278
        /usr/local/bin/alcasar-logout.sh all # logout everybody
287
        /usr/local/bin/alcasar-logout.sh all # logout everybody
279
else
288
else
280
        echo "--------------------------------------------------------------------------"
289
        echo "--------------------------------------------------------------------------"
281
        echo "**                     update/mise à jour d'ALCASAR                      **"
290
        echo "**                     update/mise à jour d'ALCASAR                      **"
282
        echo "--------------------------------------------------------------------------"
291
        echo "--------------------------------------------------------------------------"
283
        # dnsmasq & sshd should stay on to allow remote update
292
        # dnsmasq & sshd should stay on to allow remote update
284
        services="alcasar-load_balancing vnstat havp freshclam ntpd httpd radiusd mysqld dnsmasq-blacklist dnsmasq-whitelist dnsmasq-blackhole tinyproxy nfsen fail2ban ulogd-ext-access ulogd-ssh ulogd-traceability dansguardian chilli"
293
        services="alcasar-load_balancing vnstat havp freshclam ntpd lighttpd radiusd mysqld dnsmasq-blacklist dnsmasq-whitelist dnsmasq-blackhole tinyproxy nfsen fail2ban ulogd-ext-access ulogd-ssh ulogd-traceability dansguardian chilli"
285
        /usr/local/bin/alcasar-bypass.sh -on # to allow remote update
294
        /usr/local/bin/alcasar-bypass.sh -on # to allow remote update
286
fi
295
fi
-
 
296
 
-
 
297
[ -e /lib/systemd/system/httpd.service ] && services+=" httpd"
-
 
298
 
287
echo "Stopping service : "
299
echo "Stopping service : "
288
/usr/local/bin/alcasar-sms.sh --stop
300
/usr/local/bin/alcasar-sms.sh --stop
289
for i in $services
301
for i in $services
290
do
302
do
291
        if [ -e /lib/systemd/system/$i.service ]
303
        if [ -e /lib/systemd/system/$i.service ]