Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 2223 → Rev 2231

/scripts/alcasar-uninstall.sh
75,13 → 75,17
killall $i
fi
done
if [ mode == "update" ] # don't remove dnsmasq in update mode (DHCP + DNS !)
then
systemctl reload sshd
fi
echo "Reset ALCASAR main functions : "
echo -en "\n- init(1) : "
echo -en "\n- init (1) : "
# The files in /usr/local/ will be removed at the end (usefull here)
rm -f /root/ALCASAR* && echo -n "1"
sleep 1
 
echo -en "\n- ACC(11) : "
echo -en "\n- ACC (11) : "
[ -d /var/www/html ] && rm -rf /var/www/html && echo -n "1, "
[ -d /etc/freeradius-web ] && rm -rf /etc/freeradius-webl && echo -n "2, "
[ -e /etc/php.ini.default ] && mv /etc/php.ini.default /etc/php.ini && echo -n "3, "
95,7 → 99,7
[ -e /etc/httpd/conf/webapps.d/alcasar.conf ] && rm -f /etc/httpd/conf/webapps.d/alcasar.conf && echo -n "11"
sleep 1
 
echo -en "\n- CA(5) : "
echo -en "\n- CA (5) : "
[ -e /etc/pki/CA/alcasar-ca.crt ] && rm -f /etc/pki/CA/alcasar-ca.crt && echo -n "1, "
[ -e /etc/pki/CA/private/alcasar-ca.key ] && rm -f /etc/pki/CA/private/alcasar-ca.key && echo -n "2, "
[ -e /etc/pki/tls/certs/alcasar.crt ] && rm -f /etc/pki/tls/certs/alcasar.crt && echo -n "3, "
103,11 → 107,11
[ -e /etc/httpd/conf/vhosts-ssl.default ] && FIC_VIRTUAL_SSL=`find /etc/httpd/conf -type f -name *default_ssl_vhost.conf` && mv /etc/httpd/conf/vhosts-ssl.default $FIC_VIRTUAL_SSL && echo -n "5"
sleep 1
 
echo -en "\n- time_server(2) : "
echo -en "\n- time_server (2) : "
[ -e /etc/ntp/step-tickers.default ] && mv /etc/ntp/step-tickers.default /etc/ntp/step-tickers && echo -n "1, "
[ -e /etc/ntp.conf.default ] && mv /etc/ntp.conf.default /etc/ntp.conf && echo -n "2"
 
echo -en "\n- init_db(2) : "
echo -en "\n- init_db (2) : "
[ -e /etc/my.cnf.default ] && mv -f /etc/my.cnf.default /etc/my.cnf && echo -n "1, "
[ -e /lib/systemd/system/mysqld.service.default ] && mv -f /lib/systemd/system/mysqld.service.default /lib/systemd/system/mysqld.service && echo -n "2"
/usr/bin/systemctl daemon-reload
114,7 → 118,7
rm -rf /var/lib/mysql
sleep 1
 
echo -en "\n- radius(9) : "
echo -en "\n- radius (9) : "
[ -e /etc/raddb/empty-radiusd-db.sql ] && rm -f /etc/raddb/empty-radiusd-db.sql && echo -n "1, "
[ -e /etc/raddb/radiusd.conf.default ] && mv /etc/raddb/radiusd.conf.default /etc/raddb/radiusd.conf && echo -n "2, "
[ -e /etc/raddb/sites-enabled/alcasar ] && rm /etc/raddb/sites-enabled/alcasar && echo -n "3, "
126,7 → 130,7
[ -e /lib/systemd/system/radiusd.service.default ] && mv /lib/systemd/system/radiusd.service.default /lib/systemd/system/radiusd.service && echo -n "9"
sleep 1
 
echo -en "\n- chilli(4) : "
echo -en "\n- chilli (4) : "
[ -e /etc/init.d/chilli.default ] && mv /etc/init.d/chilli.default /etc/init.d/chilli && echo -n "1, "
[ -e /usr/libexec/chilli ] && rm /usr/libexec/chilli && echo -n "2, "
[ -e /etc/chilli.conf.default ] && mv /etc/chilli.conf.default /etc/chilli.conf && echo -n "3, "
133,7 → 137,7
[ -e /lib/systemd/system/chilli.service ] && rm /lib/systemd/system/chilli.service && echo -n "4"
sleep 1
 
echo -en "\n- dansguardian(8) : "
echo -en "\n- dansguardian (8) : "
[ -d /var/dansguardian ] && rm -rf /var/dansguardian && echo -n "1, "
[ -e /etc/dansguardian/dansguardian.conf.default ] && mv /etc/dansguardian/dansguardian.conf.default /etc/dansguardian/dansguardian.conf && echo -n "2, "
[ -e /etc/dansguardian/lists/bannedphraselist.default ] && mv /etc/dansguardian/lists/bannedphraselist.default /etc/dansguardian/lists/bannedphraselist && echo -n "3, "
144,7 → 148,7
[ -e /etc/dansguardian/lists/bannedsitelist.default ] && mv /etc/dansguardian/lists/bannedsitelist.default /etc/dansguardian/lists/bannedsitelist && echo -n "8"
sleep 1
 
echo -en "\n- antivirus(5) : "
echo -en "\n- antivirus (5) : "
if [ -e /etc/init.d/havp ]
then
[ -e /etc/havp/havp.config.default ] && mv /etc/havp/havp.config.default /etc/havp/havp.config && echo -n "1, "
156,7 → 160,7
fi
sleep 1
 
echo -en "\n- tinyproxy(2) : "
echo -en "\n- tinyproxy (2) : "
if [ -e /etc/init.d/tinyproxy ]
then
[ -e /etc/tinyproxy/tinyproxy.conf.default ] && mv /etc/tinyproxy/tinyproxy.conf.default /etc/tinyproxy/tinyproxy.conf && echo -n "1, "
165,7 → 169,7
fi
sleep 1
 
echo -en "\n- ulogd(6) : "
echo -en "\n- ulogd (6) : "
i=0
for log_type in traceability ssh ext-access
do
176,27 → 180,16
done
sleep 1
 
echo -en "\n- nfsen(1) : "
echo -en "\n- nfsen (1) : "
[ -e /lib/systemd/system/nfsen.service ] && rm -f /lib/systemd/system/nfsen.service && echo -n "1"
sleep 1
 
echo -en "\n- vnstat(1) : "
echo -en "\n- vnstat (1) : "
[ -e /etc/vnstat.conf.default ] && mv /etc/vnstat.conf.default /etc/vnstat.conf && echo -n "1"
sleep 1
 
echo -en "\n- dnsmasq(6 or 9) : "
if [ mode == "full " ] # don't remove dnsmasq in update mode (DHCP + DNS !)
then
if [ -e /lib/systemd/system/dnsmasq.service ]
then
[ -e /etc/sysconfig/dnsmasq.default ] && mv /etc/sysconfig/dnsmasq.default /etc/sysconfig/dnsmasq && echo -n "1, "
[ -e /etc/dnsmasq.conf.default ] && mv /etc/dnsmasq.conf.default /etc/dnsmasq.conf && echo -n "2, "
[ -e /lib/systemd/system/dnsmasq.service.default ] && mv /lib/systemd/system/dnsmasq.service.default /lib/systemd/system/dnsmasq.service && echo -n "3, "
i=3
else
i=0
fi
fi
echo -en "\n- dnsmasq (6 if update ; 9 if uninstall) : "
i=0
for list in blacklist whitelist blackhole
do
i=`expr $i + 1`
204,9 → 197,18
i=`expr $i + 1`
[ -e /lib/systemd/system/dnsmasq-$list.service ] && rm /lib/systemd/system/dnsmasq-$list.service && echo -n "$i, "
done
if [ mode == "full" ] # don't remove dnsmasq in update mode (DHCP + DNS !)
then
if [ -e /lib/systemd/system/dnsmasq.service ]
then
[ -e /etc/sysconfig/dnsmasq.default ] && mv /etc/sysconfig/dnsmasq.default /etc/sysconfig/dnsmasq && echo -n "7, "
[ -e /etc/dnsmasq.conf.default ] && mv /etc/dnsmasq.conf.default /etc/dnsmasq.conf && echo -n "8, "
[ -e /lib/systemd/system/dnsmasq.service.default ] && mv /lib/systemd/system/dnsmasq.service.default /lib/systemd/system/dnsmasq.service && echo -n "9"
fi
fi
sleep 1
 
echo -en "\n- fail2ban(8) : "
echo -en "\n- fail2ban (8) : "
[ -e /etc/fail2ban/fail2ban.conf.default ] && mv /etc/fail2ban/fail2ban.conf.default /etc/fail2ban/fail2ban.conf && echo -n "1, "
[ -e /etc/fail2ban/jail.conf.default ] && mv /etc/fail2ban/jail.conf.default /etc/fail2ban/jail.conf && echo -n "2, "
[ -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, "
217,7 → 219,7
[ -e /lib/systemd/system/fail2ban.service.default ] && mv /lib/systemd/system/fail2ban.service.default /lib/systemd/system/fail2ban.service && echo -n "8"
sleep 1
 
echo -en "\n- cron(10) : "
echo -en "\n- cron (10) : "
[ -e /etc/crontab.default ] && mv /etc/crontab.default /etc/crontab && echo -n "1, "
[ -e /etc/anacrontab.default ] && mv /etc/anacrontab.default /etc/anacrontab && echo -n "2, "
[ -e /etc/cron.d/alcasar-mysql ] && rm -f /etc/cron.d/alcasar-mysql && echo -n "3, "
230,18 → 232,22
[ -e /etc/cron.d/alcasar-rsync-bl ] && rm -f /etc/cron.d/alcasar-rsync-bl && echo -n "10,"
sleep 1
 
echo -en "\n- gammu-smsd(3) : "
echo -en "\n- gammu-smsd (3) : "
[ -e /etc/gammu_smsd_conf ] && rm -f /etc/gammu_smsd_conf && echo -n "1, "
[ -e /etc/udev/rules.d/66-huawei.rules ] && rm -f /etc/udev/rules.d/66-huawei.rules && echo -n "2, "
[ -e /var/log/gammu-smsd ] && rm -rf /var/log/gammu-smsd && echo -n "3"
sleep 1
 
echo -en "\n- msec(2) : "
[ -e /etc/security/msec/security.conf.default ] && mv /etc/security/msec/security.conf.default /etc/security/msec/security.conf && echo -n "1, "
[ -e /etc/security/msec/perm.local ] && rm -f /etc/security/msec/perm.local && echo -n "2"
echo -en "\n- msec (2) : "
if [ -e /etc/security/msec/security.conf ]
then
[ -e /etc/security/msec/security.conf.default ] && mv /etc/security/msec/security.conf.default /etc/security/msec/security.conf && echo -n "1, "
[ -e /etc/security/msec/perm.local ] && rm -f /etc/security/msec/perm.local && echo -n "2"
else echo -n "uninstalled"
fi
sleep 1
 
if [ mode == "full " ]
if [ mode == "full" ]
then
echo -en "\n- network(9) : "
hostname localhost
267,7 → 273,7
fi
 
#post_install
echo -en "\n- post_install(6) : "
echo -en "\n- post_install (6) : "
[ -e /etc/mageia-release.default ] && mv /etc/mageia-release.default /etc/mageia-release && echo -n "1, "
[ -e /etc/ssh/alcasar-banner-ssh ] && rm -f /etc/ssh/alcasar-banner-ssh && echo -n "2, "
[ -e /etc/ssh/sshd_config.default ] && mv /etc/ssh/sshd_config.default /etc/ssh/sshd_config && echo -n "3, "
276,11 → 282,10
[ -e /lib/systemd/system/alcasar-load_balancing.service ] && rm -f /lib/systemd/system/alcasar-load_balancing.service && echo -n "6"
sleep 1
 
# nettoyage (on retire les services supprimés ou remplacés dans la nouvelle version)
echo -en "\n- cleaning() : "
# Cleaning (remove all "old" alcasar scripts)
echo -en "\n- End of cleaning ..."
for rm_fic in /usr/local/bin /usr/local/etc /usr/local/sbin
do
rm -rf $rm_fic/alcasar*
done
echo