Line 1... |
Line 1... |
1 |
#!/bin/bash
|
1 |
#!/bin/bash
|
2 |
# $Id: alcasar-uninstall.sh 2740 2019-06-22 10:03:09Z rexy $
|
2 |
# $Id: alcasar-uninstall.sh 2744 2019-07-28 09:29:15Z 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 60... |
Line 60... |
60 |
rm -rf /var/lib/mysql
|
60 |
rm -rf /var/lib/mysql
|
61 |
}
|
61 |
}
|
62 |
|
62 |
|
63 |
freeradius ()
|
63 |
freeradius ()
|
64 |
{
|
64 |
{
|
65 |
echo -en "(12) : "
|
65 |
echo -en "(24) : "
|
66 |
[ -e /etc/raddb/empty-radiusd-db.sql ] && rm -f /etc/raddb/empty-radiusd-db.sql && echo -n "1, "
|
66 |
[ -e /etc/raddb/empty-radiusd-db.sql ] && rm -f /etc/raddb/empty-radiusd-db.sql && echo -n "1, "
|
67 |
[ -e /etc/raddb/radiusd.conf.default ] && mv /etc/raddb/radiusd.conf.default /etc/raddb/radiusd.conf && echo -n "2, "
|
67 |
[ -e /etc/raddb/radiusd.conf.default ] && mv /etc/raddb/radiusd.conf.default /etc/raddb/radiusd.conf && echo -n "2, "
|
68 |
[ -e /etc/raddb/dictionary.default ] && mv /etc/raddb/dictionary.default /etc/raddb/dictionary && echo -n "3, "
|
68 |
[ -e /etc/raddb/dictionary.default ] && mv /etc/raddb/dictionary.default /etc/raddb/dictionary && echo -n "3, "
|
69 |
[ -e /etc/raddb/sites-enabled/alcasar ] && rm /etc/raddb/sites-enabled/alcasar && echo -n "4, "
|
69 |
[ -e /etc/raddb/sites-enabled/alcasar ] && rm /etc/raddb/sites-enabled/alcasar && echo -n "4, "
|
70 |
[ -e /etc/raddb/sites-available/alcasar ] && rm /etc/raddb/sites-available/alcasar && echo -n "5, "
|
70 |
[ -e /etc/raddb/sites-available/alcasar ] && rm /etc/raddb/sites-available/alcasar && echo -n "5, "
|
71 |
[ -e /etc/raddb/sites-available/alcasar-with-ldap ] && rm /etc/raddb/sites-available/alcasar-with-ldap && echo -n "6, "
|
71 |
[ -e /etc/raddb/sites-available/alcasar-with-ldap ] && rm /etc/raddb/sites-available/alcasar-with-ldap && echo -n "6, "
|
72 |
[ -e /etc/raddb/clients.conf.default ] && mv /etc/raddb/clients.conf.default /etc/raddb/clients.conf && echo -n "7, "
|
72 |
[ -e /etc/raddb/clients.conf.default ] && mv /etc/raddb/clients.conf.default /etc/raddb/clients.conf && echo -n "7, "
|
73 |
echo -n "8"
|
73 |
i=7
|
74 |
for mods in sql sqlcounter attr_filter expiration logintime pap expr always
|
74 |
for mods in sql sqlcounter attr_filter expiration logintime pap expr always
|
75 |
do
|
75 |
do
|
- |
|
76 |
i=`expr $i + 1`
|
76 |
rm /etc/raddb/mods-enabled/$mods && echo -n "."
|
77 |
rm /etc/raddb/mods-enabled/$mods && echo -n "$i, "
|
77 |
done
|
78 |
done
|
78 |
echo -n ", "
|
- |
|
79 |
[ -e /etc/raddb/mods-available/ldap-alcasar ] && rm -f /etc/raddb/mods-enabled/ldap-alcasar && rm -f /etc/raddb/mods-available/ldap-alcasar && echo -n "9, "
|
79 |
[ -e /etc/raddb/mods-available/ldap-alcasar ] && rm -f /etc/raddb/mods-enabled/ldap-alcasar && rm -f /etc/raddb/mods-available/ldap-alcasar && echo -n "16, "
|
80 |
[ -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 /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 "17, "
|
81 |
[ -e /lib/systemd/system/radiusd.service.default ] && mv /lib/systemd/system/radiusd.service.default /lib/systemd/system/radiusd.service && echo -n "11, "
|
81 |
[ -e /lib/systemd/system/radiusd.service.default ] && mv /lib/systemd/system/radiusd.service.default /lib/systemd/system/radiusd.service && echo -n "18, "
|
82 |
[ -e /etc/raddb/mods-available/sqlcounter.default ] && mv /etc/raddb/mods-available/sqlcounter.default /etc/raddb/mods-available/sqlcounter && echo -n "12"
|
82 |
[ -e /etc/raddb/mods-available/sqlcounter.default ] && mv /etc/raddb/mods-available/sqlcounter.default /etc/raddb/mods-available/sqlcounter && echo -n "19"
|
- |
|
83 |
[ -e /etc/raddb/mods-available/sql.default ] && mv /etc/raddb/mods-available/sql.default /etc/raddb/mods-available/sql && echo -n "20"
|
83 |
[ -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 ", 12a"
|
84 |
[ -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 ", 21"
|
84 |
[ -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 ", 12b"
|
85 |
[ -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 ", 22"
|
85 |
[ -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 ", 12c"
|
86 |
[ -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 ", 23"
|
86 |
[ -e /etc/raddb/mods-config/sql/counter/mysql/expire_on_login.conf.default ] && mv /etc/raddb/mods-config/sql/counter/mysql/expire_on_login.conf.default /etc/raddb/mods-config/sql/counter/mysql/expire_on_login.conf && echo -n ", 12d"
|
87 |
[ -e /etc/raddb/mods-config/sql/counter/mysql/expire_on_login.conf.default ] && mv /etc/raddb/mods-config/sql/counter/mysql/expire_on_login.conf.default /etc/raddb/mods-config/sql/counter/mysql/expire_on_login.conf && echo -n ", 24"
|
87 |
}
|
88 |
}
|
88 |
|
89 |
|
89 |
chilli ()
|
90 |
chilli ()
|
90 |
{
|
91 |
{
|
91 |
echo -en "(4) : "
|
92 |
echo -en "(4) : "
|
Line 199... |
Line 200... |
199 |
[ -e /etc/anacrontab.default ] && mv /etc/anacrontab.default /etc/anacrontab && echo -n "11"
|
200 |
[ -e /etc/anacrontab.default ] && mv /etc/anacrontab.default /etc/anacrontab && echo -n "11"
|
200 |
}
|
201 |
}
|
201 |
|
202 |
|
202 |
fail2ban ()
|
203 |
fail2ban ()
|
203 |
{
|
204 |
{
|
204 |
echo -en "(8) : "
|
205 |
echo -en "(7) : "
|
205 |
[ -e /etc/fail2ban/fail2ban.conf.default ] && mv /etc/fail2ban/fail2ban.conf.default /etc/fail2ban/fail2ban.conf && echo -n "1, "
|
- |
|
206 |
[ -e /etc/fail2ban/jail.conf.default ] && mv /etc/fail2ban/jail.conf.default /etc/fail2ban/jail.conf && echo -n "2, "
|
206 |
[ -e /etc/fail2ban/jail.conf.default ] && mv /etc/fail2ban/jail.conf.default /etc/fail2ban/jail.conf && echo -n "1, "
|
207 |
[ -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, "
|
207 |
[ -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 "2, "
|
208 |
i=3
|
208 |
i=2
|
209 |
for filter in `ls /etc/fail2ban/filter.d/alcasar_* 2>/dev/null`
|
209 |
for filter in `ls /etc/fail2ban/filter.d/alcasar_* 2>/dev/null`
|
210 |
do
|
210 |
do
|
211 |
i=`expr $i + 1`
|
211 |
i=`expr $i + 1`
|
212 |
rm $filter && echo -n "$i, "
|
212 |
rm $filter && echo -n "$i, "
|
213 |
done
|
213 |
done
|
214 |
[ -e /lib/systemd/system/fail2ban.service.default ] && mv /lib/systemd/system/fail2ban.service.default /lib/systemd/system/fail2ban.service && echo -n "8"
|
214 |
[ -e /lib/systemd/system/fail2ban.service.default ] && mv /lib/systemd/system/fail2ban.service.default /lib/systemd/system/fail2ban.service && echo -n "7"
|
215 |
}
|
215 |
}
|
216 |
|
216 |
|
217 |
gammu_smsd ()
|
217 |
gammu_smsd ()
|
218 |
{
|
218 |
{
|
219 |
echo -en "(4) : "
|
219 |
echo -en "(4) : "
|