Subversion Repositories ALCASAR

Rev

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

Rev 1889 Rev 1962
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
# $Id: alcasar-bypass.sh 1889 2016-05-12 21:58:54Z richard $
2
# $Id: alcasar-bypass.sh 1962 2016-06-24 17:21:40Z richard $
3
 
3
 
4
# alcasar-bypass.sh
4
# alcasar-bypass.sh
5
# by 3abtux and Rexy
5
# by 3abtux and 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
 
8
# activation / désactivation du contournement de l'authentification et du filtrage WEB
8
# activation / désactivation du contournement de l'authentification et du filtrage WEB
9
# enable / disable the bypass of authenticate process and filtering
9
# enable / disable the bypass of authentication process and WEB filtering
10
 
10
 
11
usage="Usage: alcasar-bypass.sh {--on or -on } | {--off or -off}"
11
usage="Usage: alcasar-bypass.sh {--on or -on } | {--off or -off}"
12
SED="/bin/sed -i"
12
SED="/bin/sed -i"
13
CONF_FILE="/usr/local/etc/alcasar.conf"
13
CONF_FILE="/usr/local/etc/alcasar.conf"
14
INTIF=`grep ^INTIF= $CONF_FILE|cut -d"=" -f2`				# INTernal InterFace
14
INTIF=`grep ^INTIF= $CONF_FILE|cut -d"=" -f2`				# INTernal InterFace
Line 32... Line 32...
32
		ifup $INTIF
32
		ifup $INTIF
33
		sh /usr/local/bin/alcasar-iptables-bypass.sh
33
		sh /usr/local/bin/alcasar-iptables-bypass.sh
34
		DHCP=`grep ^DHCP= $CONF_FILE|cut -d"=" -f2`
34
		DHCP=`grep ^DHCP= $CONF_FILE|cut -d"=" -f2`
35
		if  [ $DHCP != off ] 
35
		if  [ $DHCP != off ] 
36
		then 
36
		then 
37
			$SED "/^#dhcp-range/s/^#//" /etc/dnsmasq.conf # dnsmasq become the DHCP server
37
			$SED "/^#dhcp-range=/s/^#//" /etc/dnsmasq.conf # dnsmasq become the DHCP server
38
			$SED "/^#dhcp-option/s/^#//" /etc/dnsmasq.conf
38
			$SED "/^#dhcp-option=/s/^#//" /etc/dnsmasq.conf
-
 
39
			$SED "/^#domain=/s/^#//" /etc/dnsmasq.conf
39
			$SED "s?^no-dhcp-interface.*?#&?g" /etc/dnsmasq.conf
40
			$SED "s?^no-dhcp-interface.*?#&?g" /etc/dnsmasq.conf
40
			/usr/bin/systemctl restart dnsmasq
41
			/usr/bin/systemctl restart dnsmasq
41
		fi
42
		fi
42
 
43
 
43
		rm -f /etc/cron.d/alcasar-daemon-watchdog # don't restart daemons (specially coova) 
44
		rm -f /etc/cron.d/alcasar-daemon-watchdog # don't restart daemons (specially coova) 
Line 45... Line 46...
45
		echo "ALCASAR is in 'bypass' mode"
46
		echo "ALCASAR is in 'bypass' mode"
46
		;;
47
		;;
47
	--off | -off)
48
	--off | -off)
48
		cp -f /etc/sysconfig/network-scripts/default-ifcfg-$INTIF /etc/sysconfig/network-scripts/ifcfg-$INTIF
49
		cp -f /etc/sysconfig/network-scripts/default-ifcfg-$INTIF /etc/sysconfig/network-scripts/ifcfg-$INTIF
49
		ifup $INTIF
50
		ifup $INTIF
50
		$SED "s?^dhcp-range.*?#&?g" /etc/dnsmasq.conf # dnsmasq is no more the DHCP server (it's coova) 
51
		$SED "s?^dhcp-range=.*?#&?g" /etc/dnsmasq.conf # dnsmasq is no more the DHCP server (it's coova) 
51
		$SED "s?^dhcp-option.*?#&?g" /etc/dnsmasq.conf
52
		$SED "s?^dhcp-option=.*?#&?g" /etc/dnsmasq.conf
-
 
53
		$SED "s?^domain=.*?#&?g" /etc/dnsmasq.conf
52
		$SED "/^#no-dhcp-interface/s/^#//" /etc/dnsmasq.conf
54
		$SED "/^#no-dhcp-interface/s/^#//" /etc/dnsmasq.conf
53
		/usr/bin/systemctl restart dnsmasq
55
		/usr/bin/systemctl restart dnsmasq
54
		/usr/bin/systemctl start chilli
56
		/usr/bin/systemctl start chilli
55
		sh /usr/local/bin/alcasar-iptables.sh
57
		sh /usr/local/bin/alcasar-iptables.sh
56
		# activation of the "daemon-watchdog" every 18'
58
		# activation of the "daemon-watchdog" every 18'