Line 1... |
Line 1... |
1 |
#!/bin/sh
|
1 |
#!/bin/sh
|
2 |
# $Id: alcasar-uninstall.sh 288 2010-09-27 22:05:25Z richard $
|
2 |
# $Id: alcasar-uninstall.sh 294 2010-10-05 22:01:03Z richard $
|
3 |
|
3 |
|
4 |
# alcasar-uninstall.sh
|
4 |
# alcasar-uninstall.sh
|
5 |
# by 3abtux, angel95 and rexy
|
5 |
# by 3abtux, angel95 and rexy
|
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 |
SED="/bin/sed -i"
|
7 |
SED="/bin/sed -i"
|
Line 9... |
Line 9... |
9 |
echo "-----------------------------------------------------------------------------"
|
9 |
echo "-----------------------------------------------------------------------------"
|
10 |
echo "** Désinstallation d'ALCASAR **"
|
10 |
echo "** Désinstallation d'ALCASAR **"
|
11 |
echo "-----------------------------------------------------------------------------"
|
11 |
echo "-----------------------------------------------------------------------------"
|
12 |
echo
|
12 |
echo
|
13 |
#services_stop
|
13 |
#services_stop
|
14 |
for i in squid ntpd iptables ulogd dansguardian chilli httpd radiusd freshclam havp dnsmasq named dhcpd
|
14 |
for i in squid ntpd iptables ulogd dansguardian chilli httpd radiusd freshclam havp dnsmasq mysqld named dhcpd
|
15 |
do
|
15 |
do
|
16 |
[ -e /etc/init.d/$i ] && /sbin/chkconfig --del $i && /etc/init.d/$i stop
|
16 |
[ -e /etc/init.d/$i ] && /sbin/chkconfig --del $i && /etc/init.d/$i stop && killall $i 2>/dev/null
|
17 |
done
|
17 |
done
|
18 |
echo "Réinitialisation des fonctions : "
|
18 |
echo "Réinitialisation des fonctions : "
|
19 |
|
19 |
|
20 |
#init
|
20 |
#init
|
21 |
echo -en "\n- init(1) : "
|
21 |
echo -en "\n- init(1) : "
|
Line 41... |
Line 41... |
41 |
sleep 1
|
41 |
sleep 1
|
42 |
|
42 |
|
43 |
#init_db
|
43 |
#init_db
|
44 |
echo -en "\n- init_db(2) : 1, "
|
44 |
echo -en "\n- init_db(2) : 1, "
|
45 |
[ -e /etc/my.cnf.default ] && mv -f /etc/my.cnf.default /etc/my.cnf && echo -n "2 "
|
45 |
[ -e /etc/my.cnf.default ] && mv -f /etc/my.cnf.default /etc/my.cnf && echo -n "2 "
|
46 |
/sbin/chkconfig --del mysqld
|
46 |
#/sbin/chkconfig --del mysqld
|
47 |
/etc/init.d/mysqld stop
|
47 |
#/etc/init.d/mysqld stop
|
48 |
/usr/bin/killall mysqld 2>/dev/null
|
48 |
#/usr/bin/killall mysqld 2>/dev/null
|
49 |
rm -rf /var/lib/mysql*
|
49 |
rm -rf /var/lib/mysql*
|
50 |
sleep 1
|
50 |
sleep 1
|
51 |
|
51 |
|
52 |
#param_radius
|
52 |
#param_radius
|
53 |
echo -en "\n- param_radius(7) : "
|
53 |
echo -en "\n- param_radius(7) : "
|
Line 98... |
Line 98... |
98 |
[ -d /etc/dansguardian/lists/blacklists.default ] && mv -f /etc/dansguardian/lists/blacklists.default /etc/dansguardian/lists/blacklists && echo -n "10"
|
98 |
[ -d /etc/dansguardian/lists/blacklists.default ] && mv -f /etc/dansguardian/lists/blacklists.default /etc/dansguardian/lists/blacklists && echo -n "10"
|
99 |
sleep 1
|
99 |
sleep 1
|
100 |
|
100 |
|
101 |
#antivirus
|
101 |
#antivirus
|
102 |
echo -en "\n- antivirus(5) : "
|
102 |
echo -en "\n- antivirus(5) : "
|
- |
|
103 |
if [ -e /etc/init.d/havp ]
|
- |
|
104 |
then
|
- |
|
105 |
# /usr/bin/killall havp 2>/dev/null
|
103 |
if [ `mount|grep 'havp-disk'|wc -l` -eq "1" ]
|
106 |
if [ `mount|grep 'havp-disk'|wc -l` -eq "1" ]
|
104 |
then
|
107 |
then
|
105 |
umount /var/tmp/havp && echo -n "1, "
|
108 |
umount /var/tmp/havp && echo -n "1, "
|
106 |
sleep 1
|
109 |
sleep 1
|
- |
|
110 |
fi
|
107 |
rm -rf /var/tmp/havp && echo -n "2, "
|
111 |
rm -rf /var/tmp/havp && echo -n "2, "
|
108 |
rm -f /tmp/havp-disk && echo -n "3, "
|
112 |
rm -f /tmp/havp-disk && echo -n "3, "
|
109 |
$SED "/^# Entry for havp/d" /etc/fstab
|
113 |
$SED "/^# Entry for havp/d" /etc/fstab
|
110 |
$SED "/^\/tmp\/havp-disk/d" /etc/fstab && echo -n "4, "
|
114 |
$SED "/^\/tmp\/havp-disk/d" /etc/fstab && echo -n "4, "
|
111 |
[ -e /etc/havp/havp.config.default ] && mv /etc/havp/havp.config.default /etc/havp/havp.config && echo -n "5"
|
115 |
[ -e /etc/havp/havp.config.default ] && mv /etc/havp/havp.config.default /etc/havp/havp.config && echo -n "5"
|
Line 113... |
Line 117... |
113 |
rm -rf /usr/local/sbin/havp
|
117 |
rm -rf /usr/local/sbin/havp
|
114 |
userdel -r havp
|
118 |
userdel -r havp
|
115 |
else echo -n "non installé"
|
119 |
else echo -n "non installé"
|
116 |
fi
|
120 |
fi
|
117 |
sleep 1
|
121 |
sleep 1
|
118 |
|
- |
|
119 |
#firewall
|
122 |
#firewall
|
120 |
echo -en "\n- firewall(1) : "
|
123 |
echo -en "\n- firewall(1) : "
|
121 |
[ -e /etc/sysconfig/iptables ] && rm -f /etc/sysconfig/iptables && echo -n "1"
|
124 |
[ -e /etc/sysconfig/iptables ] && rm -f /etc/sysconfig/iptables && echo -n "1"
|
122 |
sleep 1
|
125 |
sleep 1
|
123 |
|
126 |
|
Line 130... |
Line 133... |
130 |
echo -en "\n- dnsmasq(3) : "
|
133 |
echo -en "\n- dnsmasq(3) : "
|
131 |
if [ -e /etc/init.d/dnsmasq ]
|
134 |
if [ -e /etc/init.d/dnsmasq ]
|
132 |
then
|
135 |
then
|
133 |
[ -e /etc/dnsmasq.conf.default ] && mv /etc/dnsmasq.conf.default /etc/dnsmasq.conf && echo -n "1, "
|
136 |
[ -e /etc/dnsmasq.conf.default ] && mv /etc/dnsmasq.conf.default /etc/dnsmasq.conf && echo -n "1, "
|
134 |
[ -d /etc/dnsmasq.d ] && rm -rf /etc/dnsmasq.d && echo -n "2, "
|
137 |
[ -d /etc/dnsmasq.d ] && rm -rf /etc/dnsmasq.d && echo -n "2, "
|
135 |
[ -d /usr/local/etc/alcasar-dnsfilter-available ] && rm -rf /usr/local/etc/alcasar-dnsfilter* && echo "3"
|
138 |
[ -d /usr/local/etc/alcasar-dnsfilter-available ] && rm -rf /usr/local/etc/alcasar-dnsfilter* && echo -n "3"
|
136 |
else echo -n "non installé"
|
139 |
else echo -n "non installé"
|
137 |
fi
|
140 |
fi
|
138 |
sleep 1
|
141 |
sleep 1
|
139 |
|
142 |
|
140 |
#Bind
|
143 |
#Bind
|
Line 163... |
Line 166... |
163 |
sleep 1
|
166 |
sleep 1
|
164 |
|
167 |
|
165 |
# network
|
168 |
# network
|
166 |
echo -en "\n- network(9) : "
|
169 |
echo -en "\n- network(9) : "
|
167 |
hostname localhost
|
170 |
hostname localhost
|
- |
|
171 |
/etc/init.d/network stop
|
168 |
[ -e /etc/sysconfig/network-scripts/default-ifcfg-eth0 ] && mv /etc/sysconfig/network-scripts/default-ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0 && echo -n "1, "
|
172 |
[ -e /etc/sysconfig/network-scripts/default-ifcfg-eth0 ] && mv /etc/sysconfig/network-scripts/default-ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0 && echo -n "1, "
|
169 |
[ -e /etc/sysconfig/network.default ] && mv /etc/sysconfig/network.default /etc/sysconfig/network && echo -n "2, "
|
173 |
[ -e /etc/sysconfig/network.default ] && mv /etc/sysconfig/network.default /etc/sysconfig/network && echo -n "2, "
|
170 |
[ -e /etc/hosts.default ] && mv /etc/hosts.default /etc/hosts && echo -n "3, "
|
174 |
[ -e /etc/hosts.default ] && mv /etc/hosts.default /etc/hosts && echo -n "3, "
|
171 |
[ -e /etc/sysconfig/network-scripts/ifcfg-eth1 ] && rm -f /etc/sysconfig/network-scripts/ifcfg-eth1 && echo -n "4, "
|
175 |
[ -e /etc/sysconfig/network-scripts/ifcfg-eth1 ] && rm -f /etc/sysconfig/network-scripts/ifcfg-eth1 && echo -n "4, "
|
172 |
/etc/init.d/network restart
|
- |
|
173 |
[ -e /etc/ntp.conf.default ] && mv /etc/ntp.conf.default /etc/ntp.conf && echo -n "5, "
|
176 |
[ -e /etc/ntp.conf.default ] && mv /etc/ntp.conf.default /etc/ntp.conf && echo -n "5, "
|
174 |
[ -e /etc/dhcpd.conf.default ] && mv /etc/dhcpd.conf.default /etc/dhcpd.conf && echo -n "6, "
|
177 |
[ -e /etc/dhcpd.conf.default ] && mv /etc/dhcpd.conf.default /etc/dhcpd.conf && echo -n "6, "
|
175 |
[ -e /etc/sysconfig/dhcpd.default ] && mv /etc/sysconfig/dhcpd.default /etc/sysconfig/dhcpd && echo -n "7, "
|
178 |
[ -e /etc/sysconfig/dhcpd.default ] && mv /etc/sysconfig/dhcpd.default /etc/sysconfig/dhcpd && echo -n "7, "
|
176 |
[ -e /etc/hosts.allow.default ] && mv /etc/hosts.allow.default /etc/hosts.allow && echo -n "8, "
|
179 |
[ -e /etc/hosts.allow.default ] && mv /etc/hosts.allow.default /etc/hosts.allow && echo -n "8, "
|
177 |
[ -e /etc/hosts.deny.default ] && mv /etc/hosts.deny.default /etc/hosts.deny && echo -n "9"
|
180 |
[ -e /etc/hosts.deny.default ] && mv /etc/hosts.deny.default /etc/hosts.deny && echo -n "9"
|
Line 197... |
Line 200... |
197 |
for rm_rpm in dhcpd named
|
200 |
for rm_rpm in dhcpd named
|
198 |
do
|
201 |
do
|
199 |
/usr/sbin/urpme --auto $rm_rpm --auto-orphans 2>/dev/null
|
202 |
/usr/sbin/urpme --auto $rm_rpm --auto-orphans 2>/dev/null
|
200 |
done
|
203 |
done
|
201 |
echo
|
204 |
echo
|
- |
|
205 |
/etc/init.d/network start
|
- |
|
206 |
|