Subversion Repositories ALCASAR

Rev

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

Rev 1060 Rev 1062
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
# $Id: alcasar-bypass.sh 1060 2013-03-31 18:10:30Z richard $
2
# $Id: alcasar-bypass.sh 1062 2013-04-01 21:20:12Z richard $
3
 
3
 
4
# alcasar-bypass.sh
4
# alcasar-bypass.sh
5
# by Franck BOUIJOUX and Richard REY
5
# by Franck BOUIJOUX 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 22... Line 22...
22
		echo "$usage"
22
		echo "$usage"
23
		exit 0
23
		exit 0
24
		;;
24
		;;
25
	--on | -on)	
25
	--on | -on)	
26
		# activation du contournement
26
		# activation du contournement
27
		for i in chilli squid dansguardian havp mysqld radiusd httpd freshclam dnsmasq
27
		for i in chilli dansguardian havp mysqld radiusd httpd freshclam dnsmasq squid 
28
		do
28
		do
29
			if  (pgrep $i) > /dev/null ; then /etc/init.d/$i stop ; fi
29
			if  (pgrep $i) > /dev/null ; then /etc/init.d/$i stop ; fi
30
		done
30
		done
31
		echo "Configure eth1 ..."
31
		echo "Configure eth1 ..."
32
		cp /etc/sysconfig/network-scripts/default-ifcfg-eth1 /etc/sysconfig/network-scripts/ifcfg-eth1
32
		cp /etc/sysconfig/network-scripts/default-ifcfg-eth1 /etc/sysconfig/network-scripts/ifcfg-eth1
Line 44... Line 44...
44
		if (pgrep dnsmasq) > /dev/null ; then /etc/init.d/dnsmasq stop ; fi
44
		if (pgrep dnsmasq) > /dev/null ; then /etc/init.d/dnsmasq stop ; fi
45
		echo "Configure dnsmasq ..."
45
		echo "Configure dnsmasq ..."
46
		$SED "s?^#conf-dir=.*?conf-dir=/usr/local/share/dnsmasq-bl-enabled?g" /etc/dnsmasq-blackhole.conf
46
		$SED "s?^#conf-dir=.*?conf-dir=/usr/local/share/dnsmasq-bl-enabled?g" /etc/dnsmasq-blackhole.conf
47
		$SED "s?^#no-dhcp-interface=.*?no-dhcp-interface=eth1?g" /etc/dnsmasq.conf /etc/dnsmasq-blackhole.conf
47
		$SED "s?^#no-dhcp-interface=.*?no-dhcp-interface=eth1?g" /etc/dnsmasq.conf /etc/dnsmasq-blackhole.conf
48
		rm -f /etc/sysconfig/network-scripts/ifcfg-eth1
48
		rm -f /etc/sysconfig/network-scripts/ifcfg-eth1
49
		for i in chilli squid dansguardian havp mysqld radiusd httpd freshclam dnsmasq	
49
		for i in chilli dansguardian havp mysqld radiusd httpd freshclam dnsmasq squid	
50
		do
50
		do
51
			if  ! (pgrep $i) > /dev/null ; then /etc/init.d/$i start ; fi
51
			if  ! (pgrep $i) > /dev/null ; then /etc/init.d/$i start ; fi
52
		done
52
		done
53
		sh /usr/local/bin/alcasar-iptables.sh
53
		sh /usr/local/bin/alcasar-iptables.sh
54
		echo "L'authentification et le filtrage sont de nouveau activés"
54
		echo "L'authentification et le filtrage sont de nouveau activés"