Line 1... |
Line 1... |
1 |
#!/bin/bash
|
1 |
#!/bin/bash
|
2 |
# $Id: alcasar-uninstall.sh 2420 2017-10-01 18:56:46Z richard $
|
2 |
# $Id: alcasar-uninstall.sh 2421 2017-10-08 21:57:57Z richard $
|
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 /lib/systemd/system/mysqld.service.default ] && mv -f /lib/systemd/system/mysqld.service.default /lib/systemd/system/mysqld.service && echo -n "2"
|
116 |
[ -e /lib/systemd/system/mysqld.service.default ] && mv -f /lib/systemd/system/mysqld.service.default /lib/systemd/system/mysqld.service && echo -n "2"
|
117 |
/usr/bin/systemctl daemon-reload
|
117 |
/usr/bin/systemctl daemon-reload
|
118 |
rm -rf /var/lib/mysql
|
118 |
rm -rf /var/lib/mysql
|
119 |
sleep 1
|
119 |
sleep 1
|
120 |
|
120 |
|
121 |
echo -en "\n- radius (10) : "
|
121 |
echo -en "\n- freeradius (12) : "
|
122 |
[ -e /etc/raddb/empty-radiusd-db.sql ] && rm -f /etc/raddb/empty-radiusd-db.sql && echo -n "1, "
|
122 |
[ -e /etc/raddb/empty-radiusd-db.sql ] && rm -f /etc/raddb/empty-radiusd-db.sql && echo -n "1, "
|
123 |
[ -e /etc/raddb/radiusd.conf.default ] && mv /etc/raddb/radiusd.conf.default /etc/raddb/radiusd.conf && echo -n "2, "
|
123 |
[ -e /etc/raddb/radiusd.conf.default ] && mv /etc/raddb/radiusd.conf.default /etc/raddb/radiusd.conf && echo -n "2, "
|
124 |
[ -e /etc/raddb/sites-enabled/alcasar ] && rm /etc/raddb/sites-enabled/alcasar && echo -n "3, "
|
124 |
[ -e /etc/raddb/sites-enabled/alcasar ] && rm /etc/raddb/sites-enabled/alcasar && echo -n "3, "
|
125 |
[ -e /etc/raddb/sites-available/alcasar ] && rm /etc/raddb/sites-available/alcasar && echo -n "4, "
|
125 |
[ -e /etc/raddb/sites-available/alcasar ] && rm /etc/raddb/sites-available/alcasar && echo -n "4, "
|
126 |
[ -e /etc/raddb/clients.conf.default ] && mv /etc/raddb/clients.conf.default /etc/raddb/clients.conf && echo -n "5, "
|
126 |
[ -e /etc/raddb/clients.conf.default ] && mv /etc/raddb/clients.conf.default /etc/raddb/clients.conf && echo -n "5, "
|
127 |
[ -e /etc/raddb/mods-enabled/sql ] && rm /etc/raddb/mods-enabled/sql && echo -n "6, "
|
127 |
[ -e /etc/raddb/mods-enabled/sql ] && rm /etc/raddb/mods-enabled/sql && echo -n "6, " #Add here other mods
|
128 |
[ -e /etc/raddb/mods-available/sql.default ] && mv /etc/raddb/mods-available/sql.default /etc/raddb/mods-available/sql && echo -n "7, "
|
128 |
[ -e /etc/raddb/mods-available/sql.default ] && mv /etc/raddb/mods-available/sql.default /etc/raddb/mods-available/sql && echo -n "7, "
|
129 |
[ -e /etc/raddb/mods-config/sql/main/mysql/queries.conf.default ] && mv /etc/raddb/mods-config/sql/main/mysql/queries.conf.default /etc/raddb/mods-config/sql/main/mysql/queries.conf && echo -n "8, "
|
129 |
[ -e /etc/raddb/mods-config/sql/main/mysql/queries.conf.default ] && mv /etc/raddb/mods-config/sql/main/mysql/queries.conf.default /etc/raddb/mods-config/sql/main/mysql/queries.conf && echo -n "8, "
|
130 |
[ -e /etc/raddb/sql/mysql/counter.conf.default ] && mv /etc/raddb/sql/mysql/counter.conf.default /etc/raddb/sql/mysql/counter.conf && echo -n "9, "
|
130 |
[ -e /etc/raddb/mods-config/sql/counter/mysql/dailycounter.conf.default ] && mv /etc/raddb/mods-config/sql/counter/mysql/dailycounter.conf.default /etc/raddb/mods-config/sql/counter/mysql/dailycounter.conf && echo -n "9, "
|
- |
|
131 |
[ -e /etc/raddb/mods-config/sql/counter/mysql/monthlycounter.conf.default ] && mv /etc/raddb/mods-config/sql/counter/mysql/monthlycounter.conf.default /etc/raddb/mods-config/sql/counter/mysql/monthlycounter.conf && echo -n "10, "
|
- |
|
132 |
[ -e /etc/raddb/mods-config/sql/counter/mysql/noresetcounter.conf.default ] && mv /etc/raddb/mods-config/sql/counter/mysql/noresetcounter.conf.default /etc/raddb/mods-config/sql/counter/mysql/noresetcounter.conf && echo -n "11, "
|
131 |
[ -e /lib/systemd/system/radiusd.service.default ] && mv /lib/systemd/system/radiusd.service.default /lib/systemd/system/radiusd.service && echo -n "10"
|
133 |
[ -e /lib/systemd/system/radiusd.service.default ] && mv /lib/systemd/system/radiusd.service.default /lib/systemd/system/radiusd.service && echo -n "12"
|
132 |
sleep 1
|
134 |
sleep 1
|
133 |
|
135 |
|
134 |
echo -en "\n- chilli (4) : "
|
136 |
echo -en "\n- chilli (4) : "
|
135 |
[ -e /etc/init.d/chilli.default ] && mv /etc/init.d/chilli.default /etc/init.d/chilli && echo -n "1, "
|
137 |
[ -e /etc/init.d/chilli.default ] && mv /etc/init.d/chilli.default /etc/init.d/chilli && echo -n "1, "
|
136 |
[ -e /usr/libexec/chilli ] && rm /usr/libexec/chilli && echo -n "2, "
|
138 |
[ -e /usr/libexec/chilli ] && rm /usr/libexec/chilli && echo -n "2, "
|
Line 187... |
Line 189... |
187 |
|
189 |
|
188 |
echo -en "\n- vnstat (1) : "
|
190 |
echo -en "\n- vnstat (1) : "
|
189 |
[ -e /etc/vnstat.conf.default ] && mv /etc/vnstat.conf.default /etc/vnstat.conf && echo -n "1"
|
191 |
[ -e /etc/vnstat.conf.default ] && mv /etc/vnstat.conf.default /etc/vnstat.conf && echo -n "1"
|
190 |
sleep 1
|
192 |
sleep 1
|
191 |
|
193 |
|
192 |
echo -en "\n- dnsmasq (6 if update ; 9 if uninstall) : "
|
194 |
echo -en "\n- dnsmasq (6 if update ; 8 if uninstall) : "
|
193 |
i=0
|
195 |
i=0
|
194 |
for list in blacklist whitelist blackhole
|
196 |
for list in blacklist whitelist blackhole
|
195 |
do
|
197 |
do
|
196 |
i=`expr $i + 1`
|
198 |
i=`expr $i + 1`
|
197 |
[ -e /etc/dnsmasq-$list.conf ] && rm /etc/dnsmasq-$list.conf && echo -n "$i, "
|
199 |
[ -e /etc/dnsmasq-$list.conf ] && rm /etc/dnsmasq-$list.conf && echo -n "$i, "
|
Line 200... |
Line 202... |
200 |
done
|
202 |
done
|
201 |
if [ mode == "full" ] # don't remove dnsmasq in update mode (DHCP + DNS !)
|
203 |
if [ mode == "full" ] # don't remove dnsmasq in update mode (DHCP + DNS !)
|
202 |
then
|
204 |
then
|
203 |
if [ -e /lib/systemd/system/dnsmasq.service ]
|
205 |
if [ -e /lib/systemd/system/dnsmasq.service ]
|
204 |
then
|
206 |
then
|
205 |
[ -e /etc/sysconfig/dnsmasq.default ] && mv /etc/sysconfig/dnsmasq.default /etc/sysconfig/dnsmasq && echo -n "7, "
|
- |
|
206 |
[ -e /etc/dnsmasq.conf.default ] && mv /etc/dnsmasq.conf.default /etc/dnsmasq.conf && echo -n "8, "
|
207 |
[ -e /etc/dnsmasq.conf.default ] && mv /etc/dnsmasq.conf.default /etc/dnsmasq.conf && echo -n "7, "
|
207 |
[ -e /lib/systemd/system/dnsmasq.service.default ] && mv /lib/systemd/system/dnsmasq.service.default /lib/systemd/system/dnsmasq.service && echo -n "9"
|
208 |
[ -e /lib/systemd/system/dnsmasq.service.default ] && mv /lib/systemd/system/dnsmasq.service.default /lib/systemd/system/dnsmasq.service && echo -n "8"
|
208 |
fi
|
209 |
fi
|
209 |
fi
|
210 |
fi
|
210 |
sleep 1
|
211 |
sleep 1
|
211 |
|
212 |
|
212 |
echo -en "\n- fail2ban (8) : "
|
213 |
echo -en "\n- fail2ban (8) : "
|