Line 1... |
Line 1... |
1 |
#!/bin/bash
|
1 |
#!/bin/bash
|
2 |
# $Id: alcasar-uninstall.sh 2728 2019-05-20 20:55:06Z rexy $
|
2 |
# $Id: alcasar-uninstall.sh 2732 2019-05-26 22:03:17Z 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 70... |
Line 70... |
70 |
[ -e /etc/raddb/sites-available/alcasar-with-ldap ] && rm /etc/raddb/sites-available/alcasar-with-ldap && echo -n "6, "
|
70 |
[ -e /etc/raddb/sites-available/alcasar-with-ldap ] && rm /etc/raddb/sites-available/alcasar-with-ldap && echo -n "6, "
|
71 |
[ -e /etc/raddb/clients.conf.default ] && mv /etc/raddb/clients.conf.default /etc/raddb/clients.conf && echo -n "7, "
|
71 |
[ -e /etc/raddb/clients.conf.default ] && mv /etc/raddb/clients.conf.default /etc/raddb/clients.conf && echo -n "7, "
|
72 |
echo -n "8"
|
72 |
echo -n "8"
|
73 |
for mods in sql sqlcounter attr_filter expiration logintime pap expr always
|
73 |
for mods in sql sqlcounter attr_filter expiration logintime pap expr always
|
74 |
do
|
74 |
do
|
75 |
rm /etc/raddb/mods-enabled/$mods && echo -n"."
|
75 |
rm /etc/raddb/mods-enabled/$mods && echo -n "."
|
76 |
done
|
76 |
done
|
77 |
echo -n ", "
|
77 |
echo -n ", "
|
78 |
[ -e /etc/raddb/mods-available/ldap-alcasar ] && rm -f /etc/raddb/mods-enabled/ldap-alcasar && rm /etc/raddb/mods-available/ldap-alcasar echo -n "9, "
|
78 |
[ -e /etc/raddb/mods-available/ldap-alcasar ] && rm -f /etc/raddb/mods-enabled/ldap-alcasar && rm /etc/raddb/mods-available/ldap-alcasar echo -n "9, "
|
79 |
[ -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 "10, "
|
79 |
[ -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 "10, "
|
80 |
[ -e /lib/systemd/system/radiusd.service.default ] && mv /lib/systemd/system/radiusd.service.default /lib/systemd/system/radiusd.service && echo -n "11, "
|
80 |
[ -e /lib/systemd/system/radiusd.service.default ] && mv /lib/systemd/system/radiusd.service.default /lib/systemd/system/radiusd.service && echo -n "11, "
|
Line 284... |
Line 284... |
284 |
if [ $mode == "full" ]
|
284 |
if [ $mode == "full" ]
|
285 |
then
|
285 |
then
|
286 |
echo "----------------------------------------------------------------------------"
|
286 |
echo "----------------------------------------------------------------------------"
|
287 |
echo "** Uninstall/Désinstallation d'ALCASAR **"
|
287 |
echo "** Uninstall/Désinstallation d'ALCASAR **"
|
288 |
echo "----------------------------------------------------------------------------"
|
288 |
echo "----------------------------------------------------------------------------"
|
289 |
services="alcasar-load_balancing vnstat havp freshclam ntpd lighttpd radiusd mysqld unbound unbound-blacklist unbound-whitelist dnsmasq-whitelist unbound-blackhole tinyproxy nfsen fail2ban iptables ulogd-ext-access ulogd-ssh ulogd-traceability e2guardian dnsmasq sshd chilli"
|
289 |
services="alcasar-load_balancing vnstat havp freshclam ntpd 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"
|
290 |
/usr/local/bin/alcasar-logout.sh all # logout everybody
|
290 |
/usr/local/bin/alcasar-logout.sh all # logout everybody
|
291 |
else
|
291 |
else
|
292 |
echo "--------------------------------------------------------------------------"
|
292 |
echo "--------------------------------------------------------------------------"
|
293 |
echo "** update/mise à jour d'ALCASAR **"
|
293 |
echo "** update/mise à jour d'ALCASAR **"
|
294 |
echo "--------------------------------------------------------------------------"
|
294 |
echo "--------------------------------------------------------------------------"
|
295 |
# dnsmasq & sshd should stay on to allow remote update
|
295 |
# unbound, iptables & sshd should stay on to allow remote update
|
296 |
services="alcasar-load_balancing vnstat havp freshclam ntpd lighttpd radiusd mysqld unbound unbound-blacklist unbound-whitelist dnsmasq-whitelist unbound-blackhole tinyproxy nfsen fail2ban ulogd-ext-access ulogd-ssh ulogd-traceability e2guardian chilli"
|
296 |
services="alcasar-load_balancing vnstat havp freshclam ntpd lighttpd radiusd mysqld unbound-blacklist unbound-whitelist dnsmasq-whitelist unbound-blackhole tinyproxy nfsen fail2ban ulogd-ext-access ulogd-ssh ulogd-traceability e2guardian chilli"
|
297 |
/usr/local/bin/alcasar-bypass.sh -on # to allow remote update
|
297 |
/usr/local/bin/alcasar-bypass.sh -on # to allow remote update
|
298 |
fi
|
298 |
fi
|
299 |
|
- |
|
300 |
[ -e /lib/systemd/system/httpd.service ] && services+=" httpd"
|
299 |
old_services=" dnsmasq dnsmasq-blacklist dnsmasq-blackhole"
|
- |
|
300 |
services+=$old_services
|
301 |
|
301 |
|
302 |
echo "Stopping services : "
|
302 |
echo "Stopping services : "
|
303 |
/usr/local/bin/alcasar-sms.sh --stop
|
303 |
/usr/local/bin/alcasar-sms.sh --stop
|
304 |
for i in $services
|
304 |
for i in $services
|
305 |
do
|
305 |
do
|