Subversion Repositories ALCASAR

Rev

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

Rev 2444 Rev 2454
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
# $Id: alcasar-uninstall.sh 2444 2017-11-26 23:08:16Z richard $
2
# $Id: alcasar-uninstall.sh 2454 2017-12-09 18:59:31Z tom.houdayer $
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 52... Line 52...
52
	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"
52
	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"
53
	/usr/local/bin/alcasar-bypass.sh -on # to allow remote update
53
	/usr/local/bin/alcasar-bypass.sh -on # to allow remote update
54
fi
54
fi
55
echo "Stopping service : "
55
echo "Stopping service : "
56
/usr/local/bin/alcasar-sms.sh --stop
56
/usr/local/bin/alcasar-sms.sh --stop
57
for i in $services 
57
for i in $services
58
do
58
do
59
	if [ -e /lib/systemd/system/$i.service ] 
59
	if [ -e /lib/systemd/system/$i.service ]
60
	then
60
	then
61
		/usr/bin/systemctl disable $i.service
61
		/usr/bin/systemctl disable $i.service
62
	        /usr/bin/systemctl stop $i.service 1>/dev/null
62
		/usr/bin/systemctl stop $i.service 1>/dev/null
63
		sleep 1
63
		sleep 1
64
	else
64
	else
65
		echo "The service $i.service doesn't exist !"
65
		echo "The service $i.service doesn't exist !"
66
	fi
66
	fi
67
done
67
done
Line 155... Line 155...
155
[ -e /etc/dansguardian/lists/exceptioniplist.default ] && mv /etc/dansguardian/lists/exceptioniplist.default /etc/dansguardian/lists/exceptioniplist && echo -n "7, "
155
[ -e /etc/dansguardian/lists/exceptioniplist.default ] && mv /etc/dansguardian/lists/exceptioniplist.default /etc/dansguardian/lists/exceptioniplist && echo -n "7, "
156
[ -e /etc/dansguardian/lists/bannedsitelist.default ] && mv /etc/dansguardian/lists/bannedsitelist.default /etc/dansguardian/lists/bannedsitelist && echo -n "8"
156
[ -e /etc/dansguardian/lists/bannedsitelist.default ] && mv /etc/dansguardian/lists/bannedsitelist.default /etc/dansguardian/lists/bannedsitelist && echo -n "8"
157
sleep 1
157
sleep 1
158
 
158
 
159
echo -en "\n- antivirus (5) : "
159
echo -en "\n- antivirus (5) : "
160
if [ -e /etc/init.d/havp ] 
160
if [ -e /etc/init.d/havp ]
161
then
161
then
162
	[ -e /etc/havp/havp.config.default ] && mv /etc/havp/havp.config.default /etc/havp/havp.config && echo -n "1, "
162
	[ -e /etc/havp/havp.config.default ] && mv /etc/havp/havp.config.default /etc/havp/havp.config && echo -n "1, "
163
	userdel -r havp 2>/dev/null && echo -n "2, "
163
	userdel -r havp 2>/dev/null && echo -n "2, "
164
	[ -e /etc/init.d/havp.default ] && mv /etc/init.d/havp.default /etc/init.d/havp && echo -n "3, "
164
	[ -e /etc/init.d/havp.default ] && mv /etc/init.d/havp.default /etc/init.d/havp && echo -n "3, "
165
	[ -e /lib/systemd/system/havp.service.default ] && mv /lib/systemd/system/havp.service.default /lib/systemd/system/havp.service && echo -n "4, "
165
	[ -e /lib/systemd/system/havp.service.default ] && mv /lib/systemd/system/havp.service.default /lib/systemd/system/havp.service && echo -n "4, "
Line 167... Line 167...
167
else	echo -n "uninstalled"
167
else	echo -n "uninstalled"
168
fi
168
fi
169
sleep 1
169
sleep 1
170
 
170
 
171
echo -en "\n- tinyproxy (2) : "
171
echo -en "\n- tinyproxy (2) : "
172
if [ -e /etc/init.d/tinyproxy ] 
172
if [ -e /etc/init.d/tinyproxy ]
173
then
173
then
174
	[ -e /etc/tinyproxy/tinyproxy.conf.default ] && mv /etc/tinyproxy/tinyproxy.conf.default /etc/tinyproxy/tinyproxy.conf && echo -n "1, "
174
	[ -e /etc/tinyproxy/tinyproxy.conf.default ] && mv /etc/tinyproxy/tinyproxy.conf.default /etc/tinyproxy/tinyproxy.conf && echo -n "1, "
175
	userdel -r tinyproxy 2>/dev/null && echo -n "2"
175
	userdel -r tinyproxy 2>/dev/null && echo -n "2"
176
else	echo -n "uninstalled"
176
else	echo -n "uninstalled"
177
fi
177
fi
Line 220... Line 220...
220
[ -e /etc/fail2ban/jail.conf.default ] && mv /etc/fail2ban/jail.conf.default /etc/fail2ban/jail.conf && echo -n "2, "
220
[ -e /etc/fail2ban/jail.conf.default ] && mv /etc/fail2ban/jail.conf.default /etc/fail2ban/jail.conf && echo -n "2, "
221
[ -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, "
221
[ -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, "
222
i=3
222
i=3
223
for filter in `ls /etc/fail2ban/filter.d/alcasar_*`
223
for filter in `ls /etc/fail2ban/filter.d/alcasar_*`
224
do
224
do
225
        i=`expr $i + 1`
225
	i=`expr $i + 1`
226
        rm $filter && echo -n "$i, "
226
	rm $filter && echo -n "$i, "
227
done
227
done
228
[ -e /lib/systemd/system/fail2ban.service.default ] && mv /lib/systemd/system/fail2ban.service.default /lib/systemd/system/fail2ban.service && echo -n "8"
228
[ -e /lib/systemd/system/fail2ban.service.default ] && mv /lib/systemd/system/fail2ban.service.default /lib/systemd/system/fail2ban.service && echo -n "8"
229
sleep 1
229
sleep 1
230
 
230
 
231
echo -en "\n- cron (11) : "
231
echo -en "\n- cron (11) : "
232
i=1
232
i=1
233
for cron in `ls /etc/cron.d/alcasar-*`
233
for cron in `ls /etc/cron.d/alcasar-*`
234
do
234
do
235
        rm $cron && echo -n "$i, "
235
	rm $cron && echo -n "$i, "
236
        i=`expr $i + 1`
236
	i=`expr $i + 1`
237
done
237
done
238
[ -e /etc/crontab.default ] && mv /etc/crontab.default /etc/crontab && echo -n "10, "
238
[ -e /etc/crontab.default ] && mv /etc/crontab.default /etc/crontab && echo -n "10, "
239
[ -e /etc/anacrontab.default ] && mv /etc/anacrontab.default /etc/anacrontab && echo -n "11"
239
[ -e /etc/anacrontab.default ] && mv /etc/anacrontab.default /etc/anacrontab && echo -n "11"
240
sleep 1
240
sleep 1
241
 
241