Subversion Repositories ALCASAR

Rev

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

Rev 1567 Rev 1574
Line 1... Line 1...
1
#/bin/bash
1
#/bin/bash
2
# $Id: alcasar-conf.sh 1567 2015-02-11 23:11:33Z richard $
2
# $Id: alcasar-conf.sh 1574 2015-03-01 23:17:07Z richard $
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 146... Line 146...
146
		$DIR_SBIN/alcasar-profil.sh --list
146
		$DIR_SBIN/alcasar-profil.sh --list
147
# Start / Stop SSH Daemon
147
# Start / Stop SSH Daemon
148
		ssh_active=`grep SSH= $CONF_FILE|cut -d"=" -f2`
148
		ssh_active=`grep SSH= $CONF_FILE|cut -d"=" -f2`
149
		if [ $ssh_active = "on" ]
149
		if [ $ssh_active = "on" ]
150
		then
150
		then
151
			systemctl -q enable sshd.service
151
			/usr/bin/systemctl -q enable sshd.service
152
		else
152
		else
153
			systemctl -q disable sshd.service
153
			/usr/bin/systemctl -q disable sshd.service
154
		fi
154
		fi
155
# Remove the update folder
155
# Remove the update folder
156
		rm -rf $DIR_UPDATE
156
		rm -rf $DIR_UPDATE
157
		;;
157
		;;
158
	--apply|-apply)
158
	--apply|-apply)
Line 214... Line 214...
214
			$DIR_SBIN/alcasar-logout.sh all		
214
			$DIR_SBIN/alcasar-logout.sh all		
215
# Services stop
215
# Services stop
216
			echo -n "Stop services : "
216
			echo -n "Stop services : "
217
			for i in ntpd httpd tinyproxy dnsmasq dnsmasq-whitelist dnsmasq-blacklist chilli network 
217
			for i in ntpd httpd tinyproxy dnsmasq dnsmasq-whitelist dnsmasq-blacklist chilli network 
218
			do
218
			do
219
				systemctl stop $i && echo -n "$i, "
219
				/usr/bin/systemctl stop $i && echo -n "$i, "
220
			done
220
			done
221
			echo
221
			echo
222
		fi
222
		fi
223
 
223
 
224
# /etc/hosts
224
# /etc/hosts
Line 280... Line 280...
280
# sudoers
280
# sudoers
281
		$SED "s?^Host_Alias.*?Host_Alias	LAN_ORG=$PRIVATE_NETWORK/$PRIVATE_NETMASK,localhost		#réseau de l'organisme?g" /etc/sudoers
281
		$SED "s?^Host_Alias.*?Host_Alias	LAN_ORG=$PRIVATE_NETWORK/$PRIVATE_NETMASK,localhost		#réseau de l'organisme?g" /etc/sudoers
282
		if [ "$PARENT_SCRIPT" != "alcasar.sh" ] # don't launch on install stage
282
		if [ "$PARENT_SCRIPT" != "alcasar.sh" ] # don't launch on install stage
283
		then
283
		then
284
# Services start
284
# Services start
285
			systemctl start network && echo -n "Start service : network" && sleep 1
285
			/usr/bin/systemctl start network && echo -n "Start service : network" && sleep 1
286
			$DIR_SBIN/alcasar-dhcp.sh -$DHCP_mode && echo -n ", coova" # apply DHCP mode and start coova
286
			$DIR_SBIN/alcasar-dhcp.sh -$DHCP_mode && echo -n ", coova" # apply DHCP mode and start coova
287
			for i in dnsmasq httpd tinyproxy ntpd 
287
			for i in dnsmasq httpd tinyproxy ntpd 
288
				do
288
				do
289
					sleep 1
289
					sleep 1
290
					systemctl start $i && echo -n ", $i"
290
					/usr/bin/systemctl start $i && echo -n ", $i"
291
				done
291
				done
292
			$DIR_SBIN/alcasar-bl.sh -reload && echo ", dnsmasq-blacklist, dnsmasq-whitelist, iptables"
292
			$DIR_SBIN/alcasar-bl.sh -reload && echo ", dnsmasq-blacklist, dnsmasq-whitelist, iptables"
293
		fi
293
		fi
294
# Start / Stop SSH Daemon
294
# Start / Stop SSH Daemon
295
		ssh_active=`grep SSH= $CONF_FILE|cut -d"=" -f2`
295
		ssh_active=`grep SSH= $CONF_FILE|cut -d"=" -f2`
296
		if [ $ssh_active = "on" ]
296
		if [ $ssh_active = "on" ]
297
		then
297
		then
298
			/bin/systemctl enable sshd.service
298
			/usr/bin/systemctl enable sshd.service
299
			if [ "$PARENT_SCRIPT" != "alcasar.sh" ] # don't launch on install stage
299
			if [ "$PARENT_SCRIPT" != "alcasar.sh" ] # don't launch on install stage
300
			then
300
			then
301
				/bin/systemctl start sshd.service
301
				/usr/bin/systemctl start sshd.service
302
			fi
302
			fi
303
		else
303
		else
304
			/bin/systemctl disable sshd.service
304
			/usr/bin/systemctl disable sshd.service
305
			if [ "$PARENT_SCRIPT" != "alcasar.sh" ] # don't launch on install stage
305
			if [ "$PARENT_SCRIPT" != "alcasar.sh" ] # don't launch on install stage
306
			then
306
			then
307
				/bin/systemctl stop sshd.service
307
				/usr/bin/systemctl stop sshd.service
308
			fi
308
			fi
309
		fi
309
		fi
310
		;;
310
		;;
311
	*)
311
	*)
312
		echo "Argument inconnu :$1";
312
		echo "Argument inconnu :$1";