Subversion Repositories ALCASAR

Rev

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

Rev 2974 Rev 3018
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
# $Id: alcasar-conf.sh 2974 2021-07-16 17:30:14Z rexy $
2
# $Id: alcasar-conf.sh 3018 2022-06-04 16:54:31Z rexy $
3
 
3
 
4
# alcasar-conf.sh
4
# alcasar-conf.sh
5
# by REXY
5
# by 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
 
7
 
Line 120... Line 120...
120
 
120
 
121
###################################################
121
###################################################
122
##           Load an archive conf file           ##
122
##           Load an archive conf file           ##
123
###################################################
123
###################################################
124
	--load|-load)
124
	--load|-load)
-
 
125
		CURRENT_DIR=`pwd`  # install folder
125
		cd /var/tmp || { echo "Unable to find /var/tmp directory"; }
126
		cd /var/tmp || { echo "Unable to find /var/tmp directory"; }
126
		tar -xf alcasar-conf.tar.gz
127
		tar -xf alcasar-conf.tar.gz
127
# update alcasar.conf parameters
128
# update alcasar.conf parameters
128
		PREVIOUS_VERSION=`grep ^VERSION= $DIR_UPDATE/etc/alcasar.conf|cut -d"=" -f2`
129
		PREVIOUS_VERSION=`grep ^VERSION= $DIR_UPDATE/etc/alcasar.conf|cut -d"=" -f2`
129
		MAJ_PREVIOUS_VERSION=`echo $PREVIOUS_VERSION|cut -d"." -f1`
130
		MAJ_PREVIOUS_VERSION=`echo $PREVIOUS_VERSION|cut -d"." -f1`
Line 197... Line 198...
197
		then
198
		then
198
			/usr/bin/systemctl -q enable sshd.service
199
			/usr/bin/systemctl -q enable sshd.service
199
		else
200
		else
200
			/usr/bin/systemctl -q disable sshd.service
201
			/usr/bin/systemctl -q disable sshd.service
201
		fi
202
		fi
-
 
203
# Apply changes between versions
-
 
204
##   V5.4 --> V5.5   ##
-
 
205
		[ -e $DIR_ETC/alcasar-iptables-local.sh ] && cp $DIR_ETC/alcasar-iptables-local.sh $DIR_ETC/alcasar-iptables-local.sh.old && cp $CURRENT_DIR/conf/etc/alcasar-iptables-local.sh $DIR_ETC/   # new rule for SMTP output flows
202
# Remove the update folder
206
# Remove the update folder
203
		rm -rf $DIR_UPDATE
207
		rm -rf $DIR_UPDATE
204
		;;
208
		;;
205
 
209
 
206
####################################################
210
####################################################
Line 495... Line 499...
495
				/usr/bin/systemctl start $i && echo -n ", $i"
499
				/usr/bin/systemctl start $i && echo -n ", $i"
496
			done
500
			done
497
			$DIR_BIN/alcasar-bl.sh -reload && echo -n ", unbound-blacklist, unbound-whitelist, dnsmasq-whitelist, e2guardian, iptables"
501
			$DIR_BIN/alcasar-bl.sh -reload && echo -n ", unbound-blacklist, unbound-whitelist, dnsmasq-whitelist, e2guardian, iptables"
498
			/usr/bin/systemctl restart lighttpd && echo -n ", lighttpd"
502
			/usr/bin/systemctl restart lighttpd && echo -n ", lighttpd"
499
		fi
503
		fi
-
 
504
# Email user registration
-
 
505
		$DIR_BIN/alcasar-mail-install.sh
500
# Start / Stop SSH Daemon
506
# Start / Stop SSH Daemon
501
		ssh_active=`grep ^SSH= $CONF_FILE|cut -d"=" -f2`
507
		ssh_active=`grep ^SSH= $CONF_FILE|cut -d"=" -f2`
502
		if [ $ssh_active = "on" ]
508
		if [ $ssh_active = "on" ]
503
		then
509
		then
504
			/usr/bin/systemctl enable sshd.service
510
			/usr/bin/systemctl enable sshd.service