Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 2970 → Rev 2971

/scripts/alcasar-uninstall.sh
88,8 → 88,7
[ -e /etc/raddb/mods-available/sql.default ] && mv /etc/raddb/mods-available/sql.default /etc/raddb/mods-available/sql && echo -n "19, "
[ -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 "20, "
[ -e /etc/raddb/mods-available/sqlcounter.default ] && mv /etc/raddb/mods-available/sqlcounter.default /etc/raddb/mods-available/sqlcounter && echo -n "21, "
if [ -e /etc/systemd/system/radiusd.service ]
then
if [ -e /etc/systemd/system/radiusd.service ]; then
rm -f /etc/systemd/system/radiusd.service
echo -n "22"
fi
109,8 → 108,7
echo -en "(15) : "
[ -d /var/e2guardian ] && rm -rf /var/e2guardian
[ -d /var/dansguardian ] && rm -rf /var/dansguardian
if [ -e /etc/systemd/system/e2guardian.service ]
then
if [ -e /etc/systemd/system/e2guardian.service ]; then
rm -f /etc/systemd/system/e2guardian.service
echo -n "1, "
fi
133,13 → 131,11
antivirus ()
{
echo -en "(4) : "
if [ -e /etc/systemd/system/clamav-daemon.service ]
then
if [ -e /etc/systemd/system/clamav-daemon.service ]; then
rm -f /etc/systemd/system/clamav-daemon.service
echo -n "1, "
fi
if [ -e /etc/systemd/system/clamav-daemon.socket ]
then
if [ -e /etc/systemd/system/clamav-daemon.socket ]; then
rm -f /etc/systemd/system/clamav-daemon.socket
echo -n "2, "
fi
171,8 → 167,7
{
echo -en "(2) : "
[ -e /etc/vnstat.conf.default ] && mv /etc/vnstat.conf.default /etc/vnstat.conf && echo -n "1, "
if [ -e /etc/systemd/system/vnstat.service ]
then
if [ -e /etc/systemd/system/vnstat.service ]; then
rm -f /etc/systemd/system/vnstat.service
echo -n "2"
fi
183,8 → 178,7
echo -en "(3) : "
[ -e /etc/dnsmasq.conf.default ] && mv /etc/dnsmasq.conf.default /etc/dnsmasq.conf && echo -n "1, "
[ -e /etc/dnsmasq-whitelist.conf ] && rm /etc/dnsmasq-whitelist.conf && echo -n "2, "
if [ -e /etc/systemd/system/dnsmasq-whitelist.service ]
then
if [ -e /etc/systemd/system/dnsmasq-whitelist.service ]; then
rm -f /etc/systemd/system/dnsmasq-whitelist.service
echo -n "3, "
fi
208,8 → 202,7
fi
i=`expr $i + 1`
done
if [ -e /etc/systemd/system/unbound.service ]
then
if [ -e /etc/systemd/system/unbound.service ]; then
rm -f /etc/systemd/system/unbound.service
echo -n "9"
fi
251,8 → 244,7
i=`expr $i + 1`
rm $jail && echo -n "$i, "
done
if [ -e /etc/systemd/system/fail2ban.service ]
then
if [ -e /etc/systemd/system/fail2ban.service ]; then
rm -f /etc/systemd/system/fail2ban.service
echo -n "11"
fi
271,11 → 263,11
msec ()
{
echo -en "(2) : "
if [ -e /etc/security/msec/security.conf ]
then
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"
else
echo -n "uninstalled"
fi
}
 
304,8 → 296,7
 
nb_args=$#
args=$1
if [ $nb_args -eq 0 ]
then
if [ $nb_args -eq 0 ]; then
nb_args=1
args="-h"
fi
327,8 → 318,7
;;
esac
clear
if [ $mode == "full" ]
then
if [ $mode == "full" ]; then
echo "----------------------------------------------------------------------------"
echo "** Uninstall/Désinstallation d'ALCASAR **"
echo "----------------------------------------------------------------------------"
350,8 → 340,7
for i in $services
do
service_exist=`systemctl list-unit-files | grep ^$i.service | wc -l`
if [ $service_exist -eq 1 ]
then
if [ $service_exist -eq 1 ]; then
/usr/bin/systemctl disable $i.service
/usr/bin/systemctl stop $i.service 1>/dev/null
sleep 1
362,30 → 351,26
echo "Check the service clearing"
for i in $services
do
if [ `systemctl is-active $i.service` == "active" ]
then
if [ `systemctl is-active $i.service` == "active" ]; then
echo "The service '$i' need to be killed"
/usr/bin/systemctl stop $i.service
killall $i
fi
done
if [ $mode == "update" ] # reload sshd in case of remote update
then
/usr/bin/systemctl reload sshd
fi
 
[ $mode == "update" ] && /usr/bin/systemctl reload sshd # reload sshd in case of remote update
 
echo "Reset ALCASAR main functions : "
for func in init ACC CA time_server init_db freeradius chilli e2guardian antivirus ulogd nfsen vnstat unbound dnsmasq dhcpd cron fail2ban gammu_smsd msec letsencrypt post_install
do
echo -en "\n- $func "
$func
if [ $DEBUG_ALCASAR == "on" ]
then
if [ $DEBUG_ALCASAR == "on" ]; then
echo -n " *** 'debug' : end of cleaning '$func' *** "
read a
fi
done
if [ $mode == "full" ]
then
if [ $mode == "full" ]; then
echo -en "\n- network(10) : "
hostnamectl set-hostname localhost.localdomain
chmod a-x /etc/sysconfig/network-scripts/default-*
401,13 → 386,11
[ -e /etc/hosts.allow.default ] && mv -f /etc/hosts.allow.default /etc/hosts.allow && echo -n "5, "
[ -e /etc/hosts.deny.default ] && mv -f /etc/hosts.deny.default /etc/hosts.deny && echo -n "6, "
[ -e /etc/modprobe.preload.default ] && mv -f /etc/modprobe.preload.default /etc/modprobe.preload && echo -n "7, "
if [ -e /etc/systemd/system/alcasar-network.service ]
- then
- rm -f /etc/systemd/system/alcasar-network.service
- echo -n "8, "
- fi
if [ -e /etc/systemd/system/iptables.service ]
then
if [ -e /etc/systemd/system/alcasar-network.service ]; then
rm -f /etc/systemd/system/alcasar-network.service
echo -n "8, "
fi
if [ -e /etc/systemd/system/iptables.service ]; then
rm -f /etc/systemd/system/iptables.service
echo -n "9, "
fi
418,8 → 401,11
 
# Reset "skip.list" (we keep "kernel" in order not to download kernel we don't want to have)
echo "/^kernel/" > /etc/urpmi/skip.list
$SED "/^exclude/d" /etc/dnf/dnf.conf
 
if [ `egrep '^exclude=' /etc/dnf/dnf.conf |wc -l` -eq "1" ]; then
$SED "s?^exclude=.*?exclude=kernel\*?g" /etc/dnf/dnf.conf
else
echo "exclude=kernel*" >> /etc/dnf/dnf.conf
fi
# Cleaning (remove all "old" alcasar scripts)
echo -en "\n- End of cleaning ...\n"
for rm_fic in /usr/local/bin /usr/local/etc /usr/local/sbin
428,8 → 414,7
done
/usr/bin/update-grub2
 
if [ $mode == "full" ]
then
if [ $mode == "full" ]; then
echo -n "Waiting for Network to be up again : "
i=0
while [ $i -lt 10 ] # We wait 10 seconds max
436,8 → 421,7
do
echo -n "."
DNS1=`grep ^nameserver /etc/resolv.conf|awk -F" " '{print $2}'|head -n 1`
if [ "$DNS1" != "" ] && [ "$DNS1" != "127.0.0.1" ]
then
if [ "$DNS1" != "" ] && [ "$DNS1" != "127.0.0.1" ]; then
i=9
echo -n "ok"
fi