Subversion Repositories ALCASAR

Rev

Rev 1520 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 1520 Rev 1521
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
# $Id: alcasar-bypass.sh 1520 2014-12-17 18:10:26Z richard $
2
# $Id: alcasar-bypass.sh 1521 2014-12-17 22:57:44Z 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
 
Line 25... Line 25...
25
		echo "$usage"
25
		echo "$usage"
26
		exit 0
26
		exit 0
27
		;;
27
		;;
28
	--on | -on)	
28
	--on | -on)	
29
		/usr/local/sbin/alcasar-logout.sh all
29
		/usr/local/sbin/alcasar-logout.sh all
30
		for i in chilli 
30
		/usr/bin/systemctl stop chilli
31
		do
-
 
32
			if  (pgrep $i) > /dev/null ; then /usr/bin/systemctl stop $i.service ; fi
-
 
33
		done
-
 
34
		cp /etc/sysconfig/network-scripts/default-ifcfg-$INTIF /etc/sysconfig/network-scripts/ifcfg-$INTIF
31
		cp /etc/sysconfig/network-scripts/default-ifcfg-$INTIF /etc/sysconfig/network-scripts/ifcfg-$INTIF
35
		ifup $INTIF
32
		ifup $INTIF
36
		sh /usr/local/bin/alcasar-iptables-bypass.sh
33
		sh /usr/local/bin/alcasar-iptables-bypass.sh
37
		$SED "s?^no-dhcp-interface.*?#&?g" /etc/dnsmasq.conf # dnsmasq become the DHCP server
34
		$SED "s?^no-dhcp-interface.*?#&?g" /etc/dnsmasq.conf # dnsmasq become the DHCP server
38
		/usr/bin/systemctl restart dnsmasq
35
		/usr/bin/systemctl restart dnsmasq
Line 49... Line 46...
49
		/usr/bin/systemctl start chilli
46
		/usr/bin/systemctl start chilli
50
		sh /usr/local/bin/alcasar-iptables.sh
47
		sh /usr/local/bin/alcasar-iptables.sh
51
		# activation of the "daemon-watchdog" every 18'
48
		# activation of the "daemon-watchdog" every 18'
52
		cat << EOF > /etc/cron.d/alcasar-daemon-watchdog
49
		cat << EOF > /etc/cron.d/alcasar-daemon-watchdog
53
# activation du "chien de garde" (daemon-watchdog) toutes les 18'
50
# activation du "chien de garde" (daemon-watchdog) toutes les 18'
54
*/18 * * * * root $DIR_DEST_BIN/alcasar-daemon.sh > /dev/null 2>&1
51
*/18 * * * * root /usr/local/bin/alcasar-daemon.sh > /dev/null 2>&1
55
EOF
52
EOF
56
		echo "L'authentification et le filtrage sont actifs"
53
		echo "L'authentification et le filtrage sont actifs"
57
		echo "Authentication and filtering system are enabled"
54
		echo "Authentication and filtering system are enabled"
58
;;
55
;;
59
	*)
56
	*)