Line 1... |
Line 1... |
1 |
#!/bin/bash
|
1 |
#!/bin/bash
|
2 |
# $Id: alcasar-uninstall.sh 2768 2019-11-24 15:19:27Z rexy $
|
2 |
# $Id: alcasar-uninstall.sh 2771 2020-02-22 09:50:24Z 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 116... |
Line 116... |
116 |
[ -e /etc/e2guardian/lists/urlregexplist.default ] && mv /etc/e2guardian/lists/urlregexplist.default /etc/e2guardian/lists/urlregexplist && echo -n "15"
|
116 |
[ -e /etc/e2guardian/lists/urlregexplist.default ] && mv /etc/e2guardian/lists/urlregexplist.default /etc/e2guardian/lists/urlregexplist && echo -n "15"
|
117 |
}
|
117 |
}
|
118 |
|
118 |
|
119 |
antivirus ()
|
119 |
antivirus ()
|
120 |
{
|
120 |
{
|
121 |
echo -en "(5) : "
|
121 |
echo -en "(6) : "
|
122 |
if [ -e /etc/init.d/havp ]
|
122 |
if [ -e /etc/init.d/havp ]
|
123 |
then
|
123 |
then
|
124 |
[ -e /etc/havp/havp.config.default ] && mv /etc/havp/havp.config.default /etc/havp/havp.config && echo -n "1, "
|
124 |
[ -e /etc/havp/havp.config.default ] && mv /etc/havp/havp.config.default /etc/havp/havp.config && echo -n "1, "
|
125 |
userdel -r havp 2>/dev/null && echo -n "2, "
|
125 |
[ -d /var/run/havp ] && rm -rf /var/run/havp && echo -n "2, "
|
126 |
[ -e /etc/init.d/havp.default ] && mv /etc/init.d/havp.default /etc/init.d/havp && echo -n "3, "
|
126 |
[ -e /etc/init.d/havp.default ] && mv /etc/init.d/havp.default /etc/init.d/havp && echo -n "3, "
|
127 |
[ -e /lib/systemd/system/havp.service ] && rm /lib/systemd/system/havp.service && echo -n "4, "
|
127 |
[ -e /lib/systemd/system/havp.service ] && rm /lib/systemd/system/havp.service && echo -n "4, "
|
128 |
[ -e /etc/freshclam.conf.default ] && mv /etc/freshclam.conf.default /etc/freshclam.conf && echo -n "5"
|
128 |
[ -e /etc/freshclam.conf.default ] && mv /etc/freshclam.conf.default /etc/freshclam.conf && echo -n "5, "
|
- |
|
129 |
userdel -r havp 2>/dev/null && echo -n "6"
|
- |
|
130 |
|
129 |
else echo -n "already uninstalled"
|
131 |
else echo -n "already uninstalled"
|
130 |
fi
|
132 |
fi
|
131 |
}
|
133 |
}
|
132 |
|
134 |
|
133 |
tinyproxy ()
|
135 |
tinyproxy ()
|
134 |
{
|
136 |
{
|
135 |
echo -en "(2) : "
|
137 |
echo -en "(3) : "
|
136 |
if [ -e /etc/init.d/tinyproxy ]
|
138 |
if [ -e /etc/init.d/tinyproxy ]
|
137 |
then
|
139 |
then
|
138 |
[ -e /etc/tinyproxy/tinyproxy.conf.default ] && mv /etc/tinyproxy/tinyproxy.conf.default /etc/tinyproxy/tinyproxy.conf && echo -n "1, "
|
140 |
[ -e /etc/tinyproxy/tinyproxy.conf.default ] && mv /etc/tinyproxy/tinyproxy.conf.default /etc/tinyproxy/tinyproxy.conf && echo -n "1, "
|
- |
|
141 |
[ -d /var/run/tinyproxy ] && rm -rf /var/run/tinyproxy && echo -n "2, "
|
139 |
userdel -r tinyproxy 2>/dev/null && echo -n "2"
|
142 |
userdel -r tinyproxy 2>/dev/null && echo -n "3"
|
140 |
else echo -n "already uninstalled"
|
143 |
else echo -n "already uninstalled"
|
141 |
fi
|
144 |
fi
|
142 |
}
|
145 |
}
|
143 |
|
146 |
|
144 |
ulogd ()
|
147 |
ulogd ()
|
145 |
{
|
148 |
{
|
Line 154... |
Line 157... |
154 |
done
|
157 |
done
|
155 |
}
|
158 |
}
|
156 |
|
159 |
|
157 |
nfsen ()
|
160 |
nfsen ()
|
158 |
{
|
161 |
{
|
- |
|
162 |
# we don't remove user "nfcapd" & nfcapd folders in order to keep data when updating
|
159 |
echo -en "(1) : "
|
163 |
echo -en "(1) : "
|
160 |
[ -e /lib/systemd/system/nfsen.service ] && rm -f /lib/systemd/system/nfsen.service && echo -n "1"
|
164 |
[ -e /lib/systemd/system/nfcapd.service ] && rm -f /lib/systemd/system/nfcapd.service && echo -n "1"
|
161 |
}
|
165 |
}
|
162 |
|
166 |
|
163 |
vnstat ()
|
167 |
vnstat ()
|
164 |
{
|
168 |
{
|
165 |
echo -en "(1) : "
|
169 |
echo -en "(1) : "
|
Line 289... |
Line 293... |
289 |
if [ $mode == "full" ]
|
293 |
if [ $mode == "full" ]
|
290 |
then
|
294 |
then
|
291 |
echo "----------------------------------------------------------------------------"
|
295 |
echo "----------------------------------------------------------------------------"
|
292 |
echo "** Uninstall/Désinstallation d'ALCASAR **"
|
296 |
echo "** Uninstall/Désinstallation d'ALCASAR **"
|
293 |
echo "----------------------------------------------------------------------------"
|
297 |
echo "----------------------------------------------------------------------------"
|
294 |
services="alcasar-load_balancing vnstat havp clamav-freshclam ntpd php-fpm lighttpd radiusd mysqld unbound unbound-blacklist unbound-whitelist dnsmasq-whitelist unbound-blackhole tinyproxy nfsen fail2ban iptables ulogd-ext-access ulogd-ssh ulogd-traceability e2guardian sshd chilli"
|
298 |
services="alcasar-load_balancing vnstat havp clamav-freshclam ntpd php-fpm lighttpd radiusd mysqld unbound unbound-blacklist unbound-whitelist dnsmasq-whitelist unbound-blackhole tinyproxy nfcapd fail2ban iptables ulogd-ext-access ulogd-ssh ulogd-traceability e2guardian sshd chilli"
|
295 |
/usr/local/bin/alcasar-logout.sh all # logout everybody
|
299 |
/usr/local/bin/alcasar-logout.sh all # logout everybody
|
296 |
else
|
300 |
else
|
297 |
echo "--------------------------------------------------------------------------"
|
301 |
echo "--------------------------------------------------------------------------"
|
298 |
echo "** update/mise à jour d'ALCASAR **"
|
302 |
echo "** update/mise à jour d'ALCASAR **"
|
299 |
echo "--------------------------------------------------------------------------"
|
303 |
echo "--------------------------------------------------------------------------"
|
300 |
# unbound, iptables & sshd should stay on to allow remote update
|
304 |
# unbound, iptables & sshd should stay on to allow remote update
|
301 |
services="alcasar-load_balancing vnstat havp clamav-freshclam ntpd php-fpm lighttpd radiusd mysqld unbound-blacklist unbound-whitelist dnsmasq-whitelist unbound-blackhole tinyproxy nfsen fail2ban ulogd-ext-access ulogd-ssh ulogd-traceability e2guardian chilli"
|
305 |
services="alcasar-load_balancing vnstat havp clamav-freshclam ntpd php-fpm lighttpd radiusd mysqld unbound-blacklist unbound-whitelist dnsmasq-whitelist unbound-blackhole tinyproxy nfcapd fail2ban ulogd-ext-access ulogd-ssh ulogd-traceability e2guardian chilli"
|
302 |
/usr/local/bin/alcasar-bypass.sh -on # to allow remote update
|
306 |
/usr/local/bin/alcasar-bypass.sh -on # to allow remote update
|
303 |
fi
|
307 |
fi
|
304 |
old_services=" dnsmasq dnsmasq-blacklist dnsmasq-blackhole"
|
- |
|
305 |
services+=$old_services
|
- |
|
306 |
|
308 |
|
307 |
echo "Stopping services : "
|
309 |
echo "Stopping services : "
|
308 |
/usr/local/bin/alcasar-sms.sh --stop
|
310 |
/usr/local/bin/alcasar-sms.sh --stop
|
309 |
for i in $services
|
311 |
for i in $services
|
310 |
do
|
312 |
do
|