Line 1... |
Line 1... |
1 |
|
1 |
|
2 |
#!/bin/bash
|
2 |
#!/bin/bash
|
3 |
# $Id: alcasar-uninstall.sh 2211 2017-05-08 16:39:43Z richard $
|
3 |
# $Id: alcasar-uninstall.sh 2212 2017-05-08 17:36:03Z richard $
|
4 |
|
4 |
|
5 |
# alcasar-uninstall.sh
|
5 |
# alcasar-uninstall.sh
|
6 |
# by Franck BOUIJOUX, Pascal LEVANT and Richard REY
|
6 |
# by Franck BOUIJOUX, Pascal LEVANT and Richard REY
|
7 |
# This script is distributed under the Gnu General Public License (GPL)
|
7 |
# This script is distributed under the Gnu General Public License (GPL)
|
8 |
|
8 |
|
Line 48... |
Line 48... |
48 |
else
|
48 |
else
|
49 |
echo "----------------------------------------------------------------------------"
|
49 |
echo "----------------------------------------------------------------------------"
|
50 |
echo "** update/mise à jour d'ALCASAR **"
|
50 |
echo "** update/mise à jour d'ALCASAR **"
|
51 |
echo "----------------------------------------------------------------------------"
|
51 |
echo "----------------------------------------------------------------------------"
|
52 |
# dnsmasq & sshd should stay on to allow remote update
|
52 |
# dnsmasq & sshd should stay on to allow remote update
|
53 |
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 chilli"
|
53 |
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"
|
54 |
/usr/local/bin/alcasar-bypass.sh -on # to allow remote update
|
54 |
/usr/local/bin/alcasar-bypass.sh -on # to allow remote update
|
55 |
fi
|
55 |
fi
|
56 |
echo "Stopping service : "
|
56 |
echo "Stopping service : "
|
57 |
/usr/local/bin/alcasar-sms.sh --stop
|
57 |
/usr/local/bin/alcasar-sms.sh --stop
|
58 |
for i in $services
|
58 |
for i in $services
|
Line 183... |
Line 183... |
183 |
|
183 |
|
184 |
echo -en "\n- vnstat(1) : "
|
184 |
echo -en "\n- vnstat(1) : "
|
185 |
[ -e /etc/vnstat.conf.default ] && mv /etc/vnstat.conf.default /etc/vnstat.conf && echo -n "1"
|
185 |
[ -e /etc/vnstat.conf.default ] && mv /etc/vnstat.conf.default /etc/vnstat.conf && echo -n "1"
|
186 |
sleep 1
|
186 |
sleep 1
|
187 |
|
187 |
|
188 |
echo -en "\n- dnsmasq(9) : "
|
188 |
echo -en "\n- dnsmasq(6 or 9) : "
|
189 |
if [ -e /lib/systemd/system/dnsmasq.service ]
|
189 |
if [ mode == "full " ] # don't remove dnsmasq in update mode (DHCP + DNS !)
|
190 |
then
|
190 |
then
|
- |
|
191 |
if [ -e /lib/systemd/system/dnsmasq.service ]
|
- |
|
192 |
then
|
191 |
[ -e /etc/sysconfig/dnsmasq.default ] && mv /etc/sysconfig/dnsmasq.default /etc/sysconfig/dnsmasq && echo -n "1, "
|
193 |
[ -e /etc/sysconfig/dnsmasq.default ] && mv /etc/sysconfig/dnsmasq.default /etc/sysconfig/dnsmasq && echo -n "1, "
|
192 |
[ -e /etc/dnsmasq.conf.default ] && mv /etc/dnsmasq.conf.default /etc/dnsmasq.conf && echo -n "2, "
|
194 |
[ -e /etc/dnsmasq.conf.default ] && mv /etc/dnsmasq.conf.default /etc/dnsmasq.conf && echo -n "2, "
|
193 |
[ -e /lib/systemd/system/dnsmasq.service.default ] && mv /lib/systemd/system/dnsmasq.service.default /lib/systemd/system/dnsmasq.service && echo -n "3, "
|
195 |
[ -e /lib/systemd/system/dnsmasq.service.default ] && mv /lib/systemd/system/dnsmasq.service.default /lib/systemd/system/dnsmasq.service && echo -n "3, "
|
194 |
i=3
|
196 |
i=3
|
- |
|
197 |
else
|
- |
|
198 |
i=0
|
- |
|
199 |
fi
|
195 |
for list in blacklist whitelist blackhole
|
200 |
for list in blacklist whitelist blackhole
|
196 |
do
|
201 |
do
|
197 |
i=`expr $i + 1`
|
202 |
i=`expr $i + 1`
|
198 |
[ -e /etc/dnsmasq-$list.conf ] && rm /etc/dnsmasq-$list.conf && echo -n "$i, "
|
203 |
[ -e /etc/dnsmasq-$list.conf ] && rm /etc/dnsmasq-$list.conf && echo -n "$i, "
|
199 |
i=`expr $i + 1`
|
204 |
i=`expr $i + 1`
|
200 |
[ -e /lib/systemd/system/dnsmasq-$list.service ] && rm /lib/systemd/system/dnsmasq-$list.service && echo -n "$i, "
|
205 |
[ -e /lib/systemd/system/dnsmasq-$list.service ] && rm /lib/systemd/system/dnsmasq-$list.service && echo -n "$i, "
|
201 |
done
|
206 |
done
|
202 |
else echo -n "uninstalled"
|
- |
|
203 |
fi
|
- |
|
204 |
sleep 1
|
- |
|
205 |
|
- |
|
206 |
echo -en "\n- BL(0) : "
|
- |
|
207 |
sleep 1
|
207 |
sleep 1
|
208 |
|
208 |
|
209 |
echo -en "\n- fail2ban(8) : "
|
209 |
echo -en "\n- fail2ban(8) : "
|
210 |
[ -e /etc/fail2ban/fail2ban.conf.default ] && mv /etc/fail2ban/fail2ban.conf.default /etc/fail2ban/fail2ban.conf && echo -n "1, "
|
210 |
[ -e /etc/fail2ban/fail2ban.conf.default ] && mv /etc/fail2ban/fail2ban.conf.default /etc/fail2ban/fail2ban.conf && echo -n "1, "
|
211 |
[ -e /etc/fail2ban/jail.conf.default ] && mv /etc/fail2ban/jail.conf.default /etc/fail2ban/jail.conf && echo -n "2, "
|
211 |
[ -e /etc/fail2ban/jail.conf.default ] && mv /etc/fail2ban/jail.conf.default /etc/fail2ban/jail.conf && echo -n "2, "
|