Subversion Repositories ALCASAR

Rev

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

Rev 1062 Rev 1377
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
# $Id: alcasar-bypass.sh 1062 2013-04-01 21:20:12Z richard $
2
# $Id: alcasar-bypass.sh 1377 2014-06-10 22:16:50Z 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 31... Line 31...
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
33
		ifup eth1
33
		ifup eth1
34
		sh /usr/local/bin/alcasar-iptables-bypass.sh
34
		sh /usr/local/bin/alcasar-iptables-bypass.sh
35
		echo "Configure dnsmasq ..."
35
		echo "Configure dnsmasq ..."
36
		$SED "s?^conf-dir=.*?#&?g" /etc/dnsmasq-blackhole.conf
36
		$SED "s?^conf-dir=.*?#&?g" /etc/dnsmasq-blacklist.conf
37
		$SED "s?^no-dhcp-interface=.*?#&?g" /etc/dnsmasq.conf /etc/dnsmasq-blackhole.conf
37
		$SED "s?^no-dhcp-interface=.*?#&?g" /etc/dnsmasq.conf /etc/dnsmasq-blacklist.conf
38
		/etc/init.d/dnsmasq start
38
		/etc/init.d/dnsmasq start
39
		echo "Le contournement des modules d'authentification de filtrage est activé"
39
		echo "Le contournement des modules d'authentification de filtrage est activé"
40
		echo "les journaux de connexions continuent néanmoins d'être enregistrés"
40
		echo "les journaux de connexions continuent néanmoins d'être enregistrés"
41
		;;
41
		;;
42
	--off | -off)
42
	--off | -off)
43
		# désactivation du contournement
43
		# désactivation du contournement
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-blacklist.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-blacklist.conf
48
		rm -f /etc/sysconfig/network-scripts/ifcfg-eth1
48
		rm -f /etc/sysconfig/network-scripts/ifcfg-eth1
49
		for i in chilli dansguardian havp mysqld radiusd httpd freshclam dnsmasq squid	
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