Subversion Repositories ALCASAR

Rev

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

Rev 2521 Rev 2541
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
# $Id: alcasar-uninstall.sh 2521 2018-04-02 19:46:16Z armand.ito $
2
# $Id: alcasar-uninstall.sh 2541 2018-05-03 22:16:31Z 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 /root/grub.default ] && mv -f /root/grub.default /etc/grub.d/10_linux && echo -n "3"
20
	[ -e /root/grub.default ] && mv -f /root/grub.default /etc/grub.d/10_linux && echo -n "3"
21
}
21
}
22
 
22
 
23
ACC ()
23
ACC ()
24
{
24
{
-
 
25
	if [ -d /etc/httpd ] ; then # Removing old Apache configuration
-
 
26
		echo -en "(1) : "
-
 
27
		rm -rf /etc/httpd/ && echo -n "1"
-
 
28
	else
25
	echo -en "(7) : "
29
		echo -en "(7) : "
26
	[ -d /var/www/html ] && rm -rf /var/www/html && echo -n "1, "
30
		[ -d /var/www/html ] && rm -rf /var/www/html && echo -n "1, "
27
	[ -d /etc/freeradius-web ] && rm -rf /etc/freeradius-webl && echo -n "2, "
31
		[ -d /etc/freeradius-web ] && rm -rf /etc/freeradius-webl && echo -n "2, "
28
	[ -e /etc/php.ini.default ] && mv -f /etc/php.ini.default /etc/php.ini && echo -n "3, "
32
		[ -e /etc/php.ini.default ] && mv -f /etc/php.ini.default /etc/php.ini && echo -n "3, "
29
	[ -e /etc/lighttpd/lighttpd.conf.default ] && mv /etc/lighttpd/lighttpd.conf.default /etc/lighttpd/lighttpd.conf && echo -n "4, "
33
		[ -e /etc/lighttpd/lighttpd.conf.default ] && mv /etc/lighttpd/lighttpd.conf.default /etc/lighttpd/lighttpd.conf && echo -n "4, "
30
	[ -e /etc/lighttpd/modules.conf.default ] && mv /etc/lighttpd/modules.conf.default /etc/lighttpd/modules.conf && echo -n "5, "
34
		[ -e /etc/lighttpd/modules.conf.default ] && mv /etc/lighttpd/modules.conf.default /etc/lighttpd/modules.conf && echo -n "5, "
31
	[ -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, "
35
		[ -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, "
32
	[ -d /usr/local/etc/digest ] && rm -rf /usr/local/etc/digest && echo -n "7, "
36
		[ -d /usr/local/etc/digest ] && rm -rf /usr/local/etc/digest && echo -n "7, "
33
	[ -e /etc/lighttpd/vhosts.d/alcasar.conf ] && rm -f /etc/lighttpd/vhosts.d/alcasar.conf && echo -n "8"
37
		[ -e /etc/lighttpd/vhosts.d/alcasar.conf ] && rm -f /etc/lighttpd/vhosts.d/alcasar.conf && echo -n "8"
34
	
38
	fi
35
	# Removing old Apache configuration
-
 
36
	[ -e /etc/httpd/conf/httpd.conf.default ] && mv /etc/httpd/conf/httpd.conf.default /etc/httpd/conf/httpd.conf
-
 
37
	[ -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
-
 
38
	[ -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
-
 
39
	[ -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
-
 
40
	[ -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
-
 
41
	[ -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
-
 
42
	[ -e /etc/httpd/conf/webapps.d/alcasar.conf ] && rm -f /etc/httpd/conf/webapps.d/alcasar.conf
-
 
43
}
39
}
44
 
40
 
45
CA ()
41
CA ()
46
{
42
{
47
	echo -en "(5) : "
43
	echo -en "(5) : "
48
	[ -e /etc/pki/CA/alcasar-ca.crt ] && rm -f /etc/pki/CA/alcasar-ca.crt && echo -n "1, "
44
	[ -e /etc/pki/CA/alcasar-ca.crt ] && rm -f /etc/pki/CA/alcasar-ca.crt && echo -n "1, "
49
	[ -e /etc/pki/CA/private/alcasar-ca.key ] && rm -f /etc/pki/CA/private/alcasar-ca.key && echo -n "2, "
45
	[ -e /etc/pki/CA/private/alcasar-ca.key ] && rm -f /etc/pki/CA/private/alcasar-ca.key && echo -n "2, "
50
	[ -e /etc/pki/tls/certs/alcasar.crt ] && rm -f /etc/pki/tls/certs/alcasar.crt && echo -n "3, "
46
	[ -e /etc/pki/tls/certs/alcasar.crt ] && rm -f /etc/pki/tls/certs/alcasar.crt && echo -n "3, "
51
	[ -e /etc/pki/tls/private/alcasar.key ] && rm -f /etc/pki/tls/private/alcasar.key && echo -n "4, "
47
	[ -e /etc/pki/tls/private/alcasar.key ] && rm -f /etc/pki/tls/private/alcasar.key && echo -n "4, "
52
	[ -e /etc/pki/tls/private/alcasar.pem ] && rm -f /etc/pki/tls/private/alcasar.pem && echo -n "5"
48
	[ -e /etc/pki/tls/private/alcasar.pem ] && rm -f /etc/pki/tls/private/alcasar.pem && echo -n "5"
53
	
-
 
54
	# Removing old Apache configuration
-
 
55
	[ -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
-
 
56
}
49
}
57
 
50
 
58
time_server ()
51
time_server ()
59
{
52
{
60
	echo -en "(2) : "
53
	echo -en "(2) : "
Line 101... Line 94...
101
	[ -e /lib/systemd/system/chilli.service ] && rm /lib/systemd/system/chilli.service && echo -n "4"
94
	[ -e /lib/systemd/system/chilli.service ] && rm /lib/systemd/system/chilli.service && echo -n "4"
102
}
95
}
103
 
96
 
104
e2guardian ()
97
e2guardian ()
105
{
98
{
-
 
99
	if [ -d /etc/dansguardian ] ; then # Removing old Dansguardian
-
 
100
		echo -en "(1) : "
-
 
101
		rm -rf /etc/dansguardian/ && echo -n "1"
-
 
102
	else
106
	echo -en "(8) : "
103
		echo -en "(8) : "
107
	[ -d /var/e2guardian ] && rm -rf /var/e2guardian && echo -n "1, "
104
		[ -d /var/e2guardian ] && rm -rf /var/e2guardian && echo -n "1, "
108
	[ -e /etc/e2guardian/e2guardian.conf.default ] && mv /etc/e2guardian/e2guardian.conf.default /etc/e2guardian/e2guardian.conf && echo -n "2, "
105
		[ -e /etc/e2guardian/e2guardian.conf.default ] && mv /etc/e2guardian/e2guardian.conf.default /etc/e2guardian/e2guardian.conf && echo -n "2, "
109
	[ -e /etc/e2guardian/lists/bannedphraselist.default ] && mv /etc/e2guardian/lists/bannedphraselist.default /etc/e2guardian/lists/bannedphraselist && echo -n "3, "
106
		[ -e /etc/e2guardian/lists/bannedphraselist.default ] && mv /etc/e2guardian/lists/bannedphraselist.default /etc/e2guardian/lists/bannedphraselist && echo -n "3, "
110
	[ -e /etc/e2guardian/e2guardianf1.conf.default ] && mv /etc/e2guardian/e2guardianf1.conf.default /etc/e2guardian/e2guardianf1.conf && echo -n "4, "
107
		[ -e /etc/e2guardian/e2guardianf1.conf.default ] && mv /etc/e2guardian/e2guardianf1.conf.default /etc/e2guardian/e2guardianf1.conf && echo -n "4, "
111
	[ -e /etc/e2guardian/lists/bannedextensionlist.default ] && mv /etc/e2guardian/lists/bannedextensionlist.default /etc/e2guardian/lists/bannedextensionlist && echo -n "5, "
108
		[ -e /etc/e2guardian/lists/bannedextensionlist.default ] && mv /etc/e2guardian/lists/bannedextensionlist.default /etc/e2guardian/lists/bannedextensionlist && echo -n "5, "
112
	[ -e /etc/e2guardian/lists/bannedmimetypelist.default ] && mv /etc/e2guardian/lists/bannedmimetypelist.default /etc/e2guardian/lists/bannedmimetypelist && echo -n "6, "
109
		[ -e /etc/e2guardian/lists/bannedmimetypelist.default ] && mv /etc/e2guardian/lists/bannedmimetypelist.default /etc/e2guardian/lists/bannedmimetypelist && echo -n "6, "
113
	[ -e /etc/e2guardian/lists/exceptioniplist.default ] && mv /etc/e2guardian/lists/exceptioniplist.default /etc/e2guardian/lists/exceptioniplist && echo -n "7, "
110
		[ -e /etc/e2guardian/lists/exceptioniplist.default ] && mv /etc/e2guardian/lists/exceptioniplist.default /etc/e2guardian/lists/exceptioniplist && echo -n "7, "
114
	[ -e /etc/e2guardian/lists/bannedsitelist.default ] && mv /etc/e2guardian/lists/bannedsitelist.default /etc/e2guardian/lists/bannedsitelist && echo -n "8"
111
		[ -e /etc/e2guardian/lists/bannedsitelist.default ] && mv /etc/e2guardian/lists/bannedsitelist.default /etc/e2guardian/lists/bannedsitelist && echo -n "8"
-
 
112
	fi
115
}
113
}
116
 
114
 
117
antivirus ()
115
antivirus ()
118
{
116
{
119
	echo -en "(5) : "
117
	echo -en "(5) : "
Line 296... Line 294...
296
	/usr/local/bin/alcasar-bypass.sh -on # to allow remote update
294
	/usr/local/bin/alcasar-bypass.sh -on # to allow remote update
297
fi
295
fi
298
 
296
 
299
[ -e /lib/systemd/system/httpd.service ] && services+=" httpd"
297
[ -e /lib/systemd/system/httpd.service ] && services+=" httpd"
300
 
298
 
301
echo "Stopping service : "
299
echo "Stopping services : "
302
/usr/local/bin/alcasar-sms.sh --stop
300
/usr/local/bin/alcasar-sms.sh --stop
303
for i in $services
301
for i in $services
304
do
302
do
305
	if [ -e /lib/systemd/system/$i.service ]
303
	if [ -e /lib/systemd/system/$i.service ]
306
	then
304
	then