Line 1... |
Line 1... |
1 |
#!/bin/bash
|
1 |
#!/bin/bash
|
2 |
# $Id: alcasar-uninstall.sh 1362 2014-05-26 17:12:54Z richard $
|
2 |
# $Id: alcasar-uninstall.sh 1365 2014-05-28 14:38:29Z 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 76... |
Line 76... |
76 |
[ -e /etc/raddb/sql/mysql/counter.conf.default ] && mv /etc/raddb/sql/mysql/counter.conf.default /etc/raddb/sql/mysql/counter.conf && echo -n "8, "
|
76 |
[ -e /etc/raddb/sql/mysql/counter.conf.default ] && mv /etc/raddb/sql/mysql/counter.conf.default /etc/raddb/sql/mysql/counter.conf && echo -n "8, "
|
77 |
[ -e /lib/systemd/system/radiusd.service.default ] && mv /lib/systemd/system/radiusd.service.default /lib/systemd/system/radiusd.service && echo -n "9"
|
77 |
[ -e /lib/systemd/system/radiusd.service.default ] && mv /lib/systemd/system/radiusd.service.default /lib/systemd/system/radiusd.service && echo -n "9"
|
78 |
sleep 1
|
78 |
sleep 1
|
79 |
|
79 |
|
80 |
#param_web_radius
|
80 |
#param_web_radius
|
81 |
echo -en "\n- param_web_radius(3) : "
|
81 |
echo -en "\n- param_web_radius(4) : "
|
82 |
[ -e /etc/freeradius-web/admin.conf.default ] && mv /etc/freeradius-web/admin.conf.default /etc/freeradius-web/admin.conf && echo -n "1, "
|
82 |
[ -e /etc/freeradius-web/admin.conf.default ] && mv /etc/freeradius-web/admin.conf.default /etc/freeradius-web/admin.conf && echo -n "1, "
|
83 |
[ -e /etc/freeradius-web/naslist.conf ] && rm /etc/freeradius-web/naslist.conf && echo -n "2, "
|
83 |
[ -e /etc/freeradius-web/naslist.conf ] && rm /etc/freeradius-web/naslist.conf && echo -n "2, "
|
84 |
[ -e /etc/freeradius-web/user_edit.attrs.default ] && mv /etc/freeradius-web/user_edit.attrs.default /etc/freeradius-web/user_edit.attrs && echo -n "3, "
|
84 |
[ -e /etc/freeradius-web/user_edit.attrs.default ] && mv /etc/freeradius-web/user_edit.attrs.default /etc/freeradius-web/user_edit.attrs && echo -n "3, "
|
85 |
[ -e /etc/freeradius-web/sql.attrmap.default ] || mv /etc/freeradius-web/sql.attrmap.default /etc/freeradius-web/sql.attrmap && echo -n "4"
|
85 |
[ -e /etc/freeradius-web/sql.attrmap.default ] || mv /etc/freeradius-web/sql.attrmap.default /etc/freeradius-web/sql.attrmap && echo -n "4"
|
86 |
sleep 1
|
86 |
sleep 1
|
Line 126... |
Line 126... |
126 |
else echo -n "uninstalled"
|
126 |
else echo -n "uninstalled"
|
127 |
fi
|
127 |
fi
|
128 |
sleep 1
|
128 |
sleep 1
|
129 |
|
129 |
|
130 |
#param_ulogd
|
130 |
#param_ulogd
|
131 |
echo -en "\n- ulogd(2) : "
|
131 |
echo -en "\n- ulogd(6) : "
|
132 |
if [ -e /lib/systemd/system/ulogd-traceability.conf ]
|
132 |
if [ -e /lib/systemd/system/ulogd-traceability.conf ]
|
133 |
then
|
133 |
then
|
- |
|
134 |
i=0
|
- |
|
135 |
for log_type in traceability ssh ext-access
|
- |
|
136 |
do
|
- |
|
137 |
i=`expr $i + 1`
|
134 |
rm -f /etc/ulogd-* && echo -n "1, "
|
138 |
rm -f /etc/ulogd-$log_type.conf && echo -n "$i, "
|
- |
|
139 |
i=`expr $i + 1`
|
135 |
rm -f /lib/systemd/system/ulogd-* && echo -n "2"
|
140 |
rm -f /lib/systemd/system/ulogd-$log_type && echo -n "$i"
|
136 |
else echo -n "nothing to do"
|
141 |
else echo -n "nothing to do"
|
137 |
fi
|
142 |
fi
|
138 |
sleep 1
|
143 |
sleep 1
|
139 |
|
144 |
|
140 |
#nfsen
|
145 |
#nfsen
|
141 |
echo -en "\n nfsen(0) :"
|
146 |
echo -en "\n- nfsen(2) : "
|
- |
|
147 |
[ `grep "^nfsen:" /etc/passwd | wc -l` == 1 ] && userdel -r nfsen && echo -n "1, "
|
- |
|
148 |
[ `grep "^www-data:" /etc/group | wc -l` == 1 ] && userdel -r www-data && groupdel www-data ; echo -n "2"
|
- |
|
149 |
|
142 |
echo "todo!!!"
|
150 |
# We keep netflow RRD DB for the moment
|
- |
|
151 |
#[ -d /var/log/netflow ] && rm -rf /var/log/netflow && echo -n "3"
|
143 |
sleep 1
|
152 |
sleep 1
|
144 |
|
153 |
|
145 |
#DnsMasq
|
154 |
#DnsMasq
|
146 |
echo -en "\n- dnsmasq(6) : "
|
155 |
echo -en "\n- dnsmasq(6) : "
|
147 |
if [ -e /lib/systemd/system/dnsmasq.service ]
|
156 |
if [ -e /lib/systemd/system/dnsmasq.service ]
|
Line 180... |
Line 189... |
180 |
[ -e /etc/cron.d/freeradius-web ] && rm -f /etc/cron.d/freeradius-web && echo -n "9, "
|
189 |
[ -e /etc/cron.d/freeradius-web ] && rm -f /etc/cron.d/freeradius-web && echo -n "9, "
|
181 |
[ -e /etc/cron.d/alcasar-watchdog ] && rm -f /etc/cron.d/alcasar-watchdog && echo -n "10"
|
190 |
[ -e /etc/cron.d/alcasar-watchdog ] && rm -f /etc/cron.d/alcasar-watchdog && echo -n "10"
|
182 |
rm -f /etc/cron.d/coova /etc/cron.d/alcasar-bl_download
|
191 |
rm -f /etc/cron.d/coova /etc/cron.d/alcasar-bl_download
|
183 |
sleep 1
|
192 |
sleep 1
|
184 |
|
193 |
|
185 |
# network
|
194 |
#network
|
186 |
echo -en "\n- network(9) : "
|
195 |
echo -en "\n- network(9) : "
|
187 |
hostname localhost
|
196 |
hostname localhost
|
188 |
for i in /etc/sysconfig/network-scripts/default*
|
197 |
EXTIF=`/sbin/ip route|grep default|cut -d" " -f5`
|
- |
|
198 |
INTIF=`/sbin/ip link|grep '^[[:digit:]]:'|grep -v "lo\|$EXTIF"|cut -d" " -f2|tr -d ":"`
|
- |
|
199 |
i=0
|
- |
|
200 |
for nic in $EXTIF $INTIF
|
189 |
do
|
201 |
do
|
190 |
nic=`echo $i|cut -d"-" -f4`
|
202 |
i=`expr $i + 1`
|
191 |
/sbin/ifdown $nic
|
203 |
/sbin/ifdown $nic
|
192 |
mv -f $i /etc/sysconfig/network-scripts/ifcfg-$nic
|
204 |
[ -e /etc/sysconfig/network-scripts/default-ifcfg-$nic ] && mv -f /etc/sysconfig/network-scripts/default-ifcfg-$nic /etc/sysconfig/network-scripts/ifcfg-$nic && echo -n "$i, "
|
193 |
done
|
205 |
done
|
194 |
[ -e /etc/sysconfig/network.default ] && mv /etc/sysconfig/network.default /etc/sysconfig/network && echo -n "3, "
|
206 |
[ -e /etc/sysconfig/network.default ] && mv /etc/sysconfig/network.default /etc/sysconfig/network && echo -n "3, "
|
195 |
[ -e /etc/hosts.default ] && mv /etc/hosts.default /etc/hosts && echo -n "4, "
|
207 |
[ -e /etc/hosts.default ] && mv /etc/hosts.default /etc/hosts && echo -n "4, "
|
196 |
[ -e /etc/ntp.conf.default ] && mv /etc/ntp.conf.default /etc/ntp.conf && echo -n "5, "
|
208 |
[ -e /etc/ntp.conf.default ] && mv /etc/ntp.conf.default /etc/ntp.conf && echo -n "5, "
|
197 |
[ -e /etc/hosts.allow.default ] && mv /etc/hosts.allow.default /etc/hosts.allow && echo -n "6, "
|
209 |
[ -e /etc/hosts.allow.default ] && mv /etc/hosts.allow.default /etc/hosts.allow && echo -n "6, "
|
198 |
[ -e /etc/hosts.deny.default ] && mv /etc/hosts.deny.default /etc/hosts.deny && echo -n "7, "
|
210 |
[ -e /etc/hosts.deny.default ] && mv /etc/hosts.deny.default /etc/hosts.deny && echo -n "7, "
|
199 |
[ -e /etc/sysconfig/iptables ] && rm -f /etc/sysconfig/iptables && echo -n "8, "
|
211 |
[ -e /etc/sysconfig/iptables ] && rm -f /etc/sysconfig/iptables && echo -n "8, "
|
200 |
[ -e /etc/modprobe.preload.default ] && mv /etc/modprobe.preload.default /etc/modprobe.preload && echo -n "9"
|
212 |
[ -e /etc/modprobe.preload.default ] && mv /etc/modprobe.preload.default /etc/modprobe.preload && echo -n "9"
|
201 |
|
213 |
|
202 |
echo
|
214 |
echo
|
203 |
/sbin/ifup eth0
|
215 |
/sbin/ifup $EXTIF
|
204 |
sleep 1
|
216 |
sleep 1
|
205 |
|
217 |
|
206 |
#post_install
|
218 |
#post_install
|
207 |
echo -en "\n- post_install(12) : "
|
219 |
echo -en "\n- post_install(12) : "
|
208 |
[ -e /etc/mageia-release.default ] && mv /etc/mageia-release.default /etc/mageia-release && echo -n "1, "
|
220 |
[ -e /etc/mageia-release.default ] && mv /etc/mageia-release.default /etc/mageia-release && echo -n "1, "
|
Line 230... |
Line 242... |
230 |
do
|
242 |
do
|
231 |
rm -rf $rm_fic/alcasar*
|
243 |
rm -rf $rm_fic/alcasar*
|
232 |
done
|
244 |
done
|
233 |
echo
|
245 |
echo
|
234 |
|
246 |
|
235 |
# suppression des exceptions de mises à jours ( coova-chilli et freeradius)
|
247 |
#suppression des exceptions de mises à jours ( coova-chilli et freeradius)
|
236 |
sed -i '/coova.*/d' /etc/urpmi/skip.list
|
248 |
sed -i '/coova.*/d' /etc/urpmi/skip.list
|