Line 1... |
Line 1... |
1 |
#!/bin/bash
|
1 |
#!/bin/bash
|
2 |
# $Id: alcasar-uninstall.sh 1509 2014-11-30 22:45:38Z richard $
|
2 |
# $Id: alcasar-uninstall.sh 1513 2014-12-02 10:33:11Z 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 13... |
Line 13... |
13 |
echo "-----------------------------------------------------------------------------"
|
13 |
echo "-----------------------------------------------------------------------------"
|
14 |
echo "** Uninstall/Update ALCASAR **"
|
14 |
echo "** Uninstall/Update ALCASAR **"
|
15 |
echo "-----------------------------------------------------------------------------"
|
15 |
echo "-----------------------------------------------------------------------------"
|
16 |
echo
|
16 |
echo
|
17 |
#services_stop
|
17 |
#services_stop
|
18 |
echo -n "Stop ALCASAR main services : "
|
- |
|
19 |
for i in tinyproxy
|
- |
|
20 |
do
|
- |
|
21 |
[ -e /etc/init.d/$i ] && /sbin/chkconfig --del $i && /etc/init.d/$i stop && killall $i 2>/dev/null
|
- |
|
22 |
done
|
- |
|
23 |
|
- |
|
24 |
/usr/local/bin/alcasar-sms.sh --stop
|
18 |
/usr/local/bin/alcasar-sms.sh --stop
|
25 |
|
19 |
|
26 |
for i in alcasar-load_balancing mysqld ntpd fail2ban iptables ulogd-ext-access ulogd-ssh ulogd-traceability dansguardian httpd radiusd freshclam dnsmasq dnsmasq-blacklist dnsmasq-whitelist dnsmasq-blackhole dhcpd chilli havp nfsen
|
20 |
for i in alcasar-load_balancing freshclam ntpd dansguardian httpd radiusd mysqld dnsmasq dnsmasq-blacklist dnsmasq-whitelist dnsmasq-blackhole tinyproxy havp nfsen chilli fail2ban iptables ulogd-ext-access ulogd-ssh ulogd-traceability
|
27 |
do
|
21 |
do
|
28 |
[ -e /lib/systemd/system/$i.service ] && systemctl disable $i.service && systemctl stop $i.service 1>/dev/null
|
22 |
[ -e /lib/systemd/system/$i.service ] && systemctl disable $i.service && systemctl stop $i.service 1>/dev/null
|
29 |
done
|
23 |
done
|
30 |
|
24 |
|
31 |
echo "Reset ALCASAR main functions : "
|
25 |
echo "Reset ALCASAR main functions : "
|
Line 167... |
Line 161... |
167 |
else echo -n "uninstalled"
|
161 |
else echo -n "uninstalled"
|
168 |
fi
|
162 |
fi
|
169 |
sleep 1
|
163 |
sleep 1
|
170 |
|
164 |
|
171 |
#BL
|
165 |
#BL
|
172 |
echo -en "\n- BL(1) : "
|
166 |
echo -en "\n- BL(0) : "
|
173 |
[ -e /lib/systemd/system/iptables.service.default ] && mv /lib/systemd/system/iptables.service.default /lib/systemd/system/iptables.service && echo -n "1"
|
- |
|
174 |
sleep 1
|
167 |
sleep 1
|
175 |
|
168 |
|
176 |
#dhcpd
|
169 |
#dhcpd
|
177 |
echo -en "\n- dhcp-server(1) : "
|
170 |
echo -en "\n- dhcp-server(1) : "
|
178 |
if [ -e /etc/init.d/dhcpd ]
|
171 |
if [ -e /etc/init.d/dhcpd ]
|
Line 213... |
Line 206... |
213 |
[ -e /etc/udev/rules.d/66-huawei.rules ] && rm -f /etc/udev/rules.d/66-huawei.rules && echo -n "2, "
|
206 |
[ -e /etc/udev/rules.d/66-huawei.rules ] && rm -f /etc/udev/rules.d/66-huawei.rules && echo -n "2, "
|
214 |
[ -e /var/log/gammu-smsd ] && rm -rf /var/log/gammu-smsd && echo -n "3"
|
207 |
[ -e /var/log/gammu-smsd ] && rm -rf /var/log/gammu-smsd && echo -n "3"
|
215 |
sleep 1
|
208 |
sleep 1
|
216 |
|
209 |
|
217 |
#network
|
210 |
#network
|
218 |
echo -en "\n- network(8) : "
|
211 |
echo -en "\n- network(10) : "
|
219 |
hostname localhost
|
212 |
hostname localhost
|
220 |
CONF_FILE="/usr/local/etc/alcasar.conf"
|
213 |
CONF_FILE="/usr/local/etc/alcasar.conf"
|
221 |
EXTIF=`grep ^EXTIF= $CONF_FILE|cut -d"=" -f2` # EXTernal InterFace
|
214 |
EXTIF=`grep ^EXTIF= $CONF_FILE|cut -d"=" -f2` # EXTernal InterFace
|
222 |
INTIF=`grep ^INTIF= $CONF_FILE|cut -d"=" -f2` # INTernal InterFace
|
215 |
INTIF=`grep ^INTIF= $CONF_FILE|cut -d"=" -f2` # INTernal InterFace
|
223 |
i=0
|
216 |
i=0
|
Line 230... |
Line 223... |
230 |
[ -e /etc/sysconfig/network.default ] && mv /etc/sysconfig/network.default /etc/sysconfig/network && echo -n "3, "
|
223 |
[ -e /etc/sysconfig/network.default ] && mv /etc/sysconfig/network.default /etc/sysconfig/network && echo -n "3, "
|
231 |
[ -e /etc/hosts.default ] && mv /etc/hosts.default /etc/hosts && echo -n "4, "
|
224 |
[ -e /etc/hosts.default ] && mv /etc/hosts.default /etc/hosts && echo -n "4, "
|
232 |
[ -e /etc/ntp.conf.default ] && mv /etc/ntp.conf.default /etc/ntp.conf && echo -n "5, "
|
225 |
[ -e /etc/ntp.conf.default ] && mv /etc/ntp.conf.default /etc/ntp.conf && echo -n "5, "
|
233 |
[ -e /etc/hosts.allow.default ] && mv /etc/hosts.allow.default /etc/hosts.allow && echo -n "6, "
|
226 |
[ -e /etc/hosts.allow.default ] && mv /etc/hosts.allow.default /etc/hosts.allow && echo -n "6, "
|
234 |
[ -e /etc/hosts.deny.default ] && mv /etc/hosts.deny.default /etc/hosts.deny && echo -n "7, "
|
227 |
[ -e /etc/hosts.deny.default ] && mv /etc/hosts.deny.default /etc/hosts.deny && echo -n "7, "
|
235 |
[ -e /etc/modprobe.preload.default ] && mv /etc/modprobe.preload.default /etc/modprobe.preload && echo -n "8"
|
228 |
[ -e /etc/modprobe.preload.default ] && mv /etc/modprobe.preload.default /etc/modprobe.preload && echo -n "8, "
|
- |
|
229 |
[ -e /lib/systemd/system/iptables.service.default ] && mv /lib/systemd/system/iptables.service.default /lib/systemd/system/iptables.service && echo -n "9, "
|
- |
|
230 |
[ -e /usr/libexec/iptables.init.default ] && mv /usr/libexec/iptables.init.default /usr/libexec/iptables.init && echo -n "10"
|
236 |
|
231 |
|
237 |
/sbin/ifup $EXTIF
|
232 |
/sbin/ifup $EXTIF
|
238 |
sleep 1
|
233 |
sleep 1
|
239 |
|
234 |
|
240 |
#post_install
|
235 |
#post_install
|