Subversion Repositories ALCASAR

Rev

Rev 2421 | Rev 2433 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2421 Rev 2426
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
# $Id: alcasar-uninstall.sh 2421 2017-10-08 21:57:57Z richard $
2
# $Id: alcasar-uninstall.sh 2426 2017-10-11 22:01:59Z 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 73... Line 73...
73
		echo "The service '$i' need to be killed"
73
		echo "The service '$i' need to be killed"
74
		/usr/bin/systemctl stop $i.service
74
		/usr/bin/systemctl stop $i.service
75
		killall $i
75
		killall $i
76
	fi
76
	fi
77
done
77
done
78
if [ mode == "update" ] # don't remove dnsmasq in update mode (DHCP + DNS !)
78
if [ $mode == "update" ] # reload sshd in case of remote update
79
then
79
then
80
	systemctl reload sshd
80
	systemctl reload sshd
81
fi
81
fi
82
echo "Reset ALCASAR main functions : "
82
echo "Reset ALCASAR main functions : "
83
echo -en "\n- init (1) : "
83
echo -en "\n- init (1) : "
Line 198... Line 198...
198
	i=`expr $i + 1`
198
	i=`expr $i + 1`
199
	[ -e /etc/dnsmasq-$list.conf ] && rm /etc/dnsmasq-$list.conf && echo -n "$i, "
199
	[ -e /etc/dnsmasq-$list.conf ] && rm /etc/dnsmasq-$list.conf && echo -n "$i, "
200
	i=`expr $i + 1`
200
	i=`expr $i + 1`
201
	[ -e /lib/systemd/system/dnsmasq-$list.service ] && rm /lib/systemd/system/dnsmasq-$list.service && echo -n "$i, "
201
	[ -e /lib/systemd/system/dnsmasq-$list.service ] && rm /lib/systemd/system/dnsmasq-$list.service && echo -n "$i, "
202
done
202
done
203
if [ mode == "full" ] # don't remove dnsmasq in update mode (DHCP + DNS !)
203
if [ $mode == "full" ] # don't remove dnsmasq in update mode (DHCP + DNS !)
204
then
204
then
205
	if [ -e /lib/systemd/system/dnsmasq.service ]
205
	if [ -e /lib/systemd/system/dnsmasq.service ]
206
	then
206
	then
207
		[ -e /etc/dnsmasq.conf.default ] && mv /etc/dnsmasq.conf.default /etc/dnsmasq.conf && echo -n "7, "
207
		[ -e /etc/dnsmasq.conf.default ] && mv /etc/dnsmasq.conf.default /etc/dnsmasq.conf && echo -n "7, "
208
		[ -e /lib/systemd/system/dnsmasq.service.default ] && mv /lib/systemd/system/dnsmasq.service.default /lib/systemd/system/dnsmasq.service && echo -n "8"
208
		[ -e /lib/systemd/system/dnsmasq.service.default ] && mv /lib/systemd/system/dnsmasq.service.default /lib/systemd/system/dnsmasq.service && echo -n "8"
Line 228... Line 228...
228
[ -e /etc/cron.d/alcasar-archive ] && rm -f /etc/cron.d/alcasar-archive && echo -n "4, "
228
[ -e /etc/cron.d/alcasar-archive ] && rm -f /etc/cron.d/alcasar-archive && echo -n "4, "
229
[ -e /etc/cron.d/alcasar-ticket-clean ] && rm -f /etc/cron.d/alcasar-ticket-clean && echo -n "5, "
229
[ -e /etc/cron.d/alcasar-ticket-clean ] && rm -f /etc/cron.d/alcasar-ticket-clean && echo -n "5, "
230
[ -e /etc/cron.d/alcasar-distrib-updates ] && rm -f /etc/cron.d/alcasar-distrib-updates && echo -n "6, "
230
[ -e /etc/cron.d/alcasar-distrib-updates ] && rm -f /etc/cron.d/alcasar-distrib-updates && echo -n "6, "
231
[ -e /etc/cron.d/alcasar-connections-stats ] && rm -f /etc/cron.d/alcasar-connections-stats && echo -n "7, "
231
[ -e /etc/cron.d/alcasar-connections-stats ] && rm -f /etc/cron.d/alcasar-connections-stats && echo -n "7, "
232
[ -e /etc/cron.d/alcasar-watchdog ] && rm -f /etc/cron.d/alcasar-watchdog && echo -n "8, "
232
[ -e /etc/cron.d/alcasar-watchdog ] && rm -f /etc/cron.d/alcasar-watchdog && echo -n "8, "
233
[ -e /etc/cron.d/alcasar-daemon-watchdog ] && rm -f /etc/cron.d/alcasar-daemon-watchdog && echo -n "9,"
233
[ -e /etc/cron.d/alcasar-daemon-watchdog ] && rm -f /etc/cron.d/alcasar-daemon-watchdog && echo -n "9, "
234
[ -e /etc/cron.d/alcasar-rsync-bl ] && rm -f /etc/cron.d/alcasar-rsync-bl && echo -n "10,"
234
[ -e /etc/cron.d/alcasar-rsync-bl ] && rm -f /etc/cron.d/alcasar-rsync-bl && echo -n "10,"
235
sleep 1
235
sleep 1
236
 
236
 
237
echo -en "\n- gammu-smsd (3) : "
237
echo -en "\n- gammu-smsd (3) : "
238
[ -e /etc/gammu_smsd_conf ] && rm -f /etc/gammu_smsd_conf && echo -n "1, "
238
[ -e /etc/gammu_smsd_conf ] && rm -f /etc/gammu_smsd_conf && echo -n "1, "
Line 252... Line 252...
252
echo -en "\n- letsencrypt-client (2) : "
252
echo -en "\n- letsencrypt-client (2) : "
253
[ -e /usr/local/etc/letsencrypt ] && rm -rf /usr/local/etc/letsencrypt && echo -n "1, "
253
[ -e /usr/local/etc/letsencrypt ] && rm -rf /usr/local/etc/letsencrypt && echo -n "1, "
254
[ -e /opt/acme.sh ] && /opt/acme.sh/acme.sh --uninstall --nocron 1>/dev/null && echo -n "2"
254
[ -e /opt/acme.sh ] && /opt/acme.sh/acme.sh --uninstall --nocron 1>/dev/null && echo -n "2"
255
sleep 1
255
sleep 1
256
 
256
 
257
if [ mode == "full" ]
257
if [ $mode == "full" ]
258
then
258
then
259
	echo -en "\n- network(9) : "
259
	echo -en "\n- network(9) : "
260
	hostname localhost
260
	hostnamectl set-hostname localhost.localdomain
261
	CONF_FILE="/usr/local/etc/alcasar.conf"
261
	CONF_FILE="/usr/local/etc/alcasar.conf"
262
	EXTIF=`grep ^EXTIF= $CONF_FILE|cut -d"=" -f2`		# EXTernal InterFace
262
	EXTIF=`grep ^EXTIF= $CONF_FILE|cut -d"=" -f2`		# EXTernal InterFace
263
	INTIF=`grep ^INTIF= $CONF_FILE|cut -d"=" -f2`		# INTernal InterFace
263
	INTIF=`grep ^INTIF= $CONF_FILE|cut -d"=" -f2`		# INTernal InterFace
264
	i=0
264
	i=0
265
	for nic in $EXTIF $INTIF
265
	for nic in $EXTIF $INTIF