Subversion Repositories ALCASAR

Rev

Rev 1 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log

Rev 1 Rev 40
1
#!/bin/sh
1
#!/bin/sh
2
# Script portail-bypass
2
# Script portail-bypass
3
# Permet d'activer ou de désactiver le contournement de l'authentification et du filtrage WEB
3
# Permet d'activer ou de désactiver le contournement de l'authentification et du filtrage WEB
4
usage="Usage: alcasar-bypass.sh -on | -off"
4
usage="Usage: alcasar-bypass.sh -on | -off"
5
nb_args=$#
5
nb_args=$#
6
args=$1
6
args=$1
7
if [ $nb_args -eq 0 ]
7
if [ $nb_args -eq 0 ]
8
then
8
then
9
	nb_args=1
9
	nb_args=1
10
	args="-h"
10
	args="-h"
11
fi
11
fi
12
case $args in
12
case $args in
13
	-\? | -h* | --h*)
13
	-\? | -h* | --h*)
14
		echo "$usage"
14
		echo "$usage"
15
		exit 0
15
		exit 0
16
		;;
16
		;;
17
	-on)	
17
	-on)	
18
		# activation du contournement
18
		# activation du contournement
19
		for i in chilli squid dansguardian httpd mysqld radiusd
19
		for i in chilli squid dansguardian httpd mysqld radiusd
20
		do
20
		do
21
			if  (pgrep $i) > /dev/null ; then /etc/init.d/$i stop ; fi
21
			if  (pgrep $i) > /dev/null ; then /etc/init.d/$i stop ; fi
22
		done
22
		done
23
		echo "Configure eth1 ..."
23
		echo "Configure eth1 ..."
24
		ifup eth1
24
		ifup eth1
25
		sh /usr/local/bin/alcasar-iptables-bypass.sh
25
		sh /usr/local/bin/alcasar-iptables-bypass.sh
26
		if ! (pgrep dhcpd)  > /dev/null ; then /etc/init.d/dhcpd start ; fi
26
		if ! (pgrep dhcpd)  > /dev/null ; then /etc/init.d/dhcpd start ; fi
27
		echo "Le contournement du module d'authentification et de filtrage WEB est activé"
27
		echo "Le contournement du module d'authentification et de filtrage WEB est activé"
28
		echo "les journaux du parefeu continuent néanmoins d'être enregistrés"
28
		echo "les journaux du parefeu continuent néanmoins d'être enregistrés"
29
		;;
29
		;;
30
	-off)
30
	-off)
31
		# désactivation du contournement
31
		# désactivation du contournement
32
		if (pgrep dhcpd) > /dev/null ; then /etc/init.d/dhcpd stop ; fi
32
		if (pgrep dhcpd) > /dev/null ; then /etc/init.d/dhcpd stop ; fi
33
		for i in chilli squid dansguardian httpd mysqld radiusd
33
		for i in chilli squid dansguardian httpd mysqld radiusd
34
		do
34
		do
35
			if  ! (pgrep $i) > /dev/null ; then /etc/init.d/$i start ; fi
35
			if  ! (pgrep $i) > /dev/null ; then /etc/init.d/$i start ; fi
36
		done
36
		done
37
		sh /usr/local/bin/alcasar-iptables.sh
37
		sh /usr/local/bin/alcasar-iptables.sh
38
		echo "L'authentification et le filtrage WEB sont de nouveau activés"
38
		echo "L'authentification et le filtrage WEB sont de nouveau activés"
39
;;
39
;;
40
	*)
40
	*)
41
		echo "Argument inconnu :$1";
41
		echo "Argument inconnu :$1";
42
		echo "$usage"
42
		echo "$usage"
43
		exit 1
43
		exit 1
44
		;;
44
		;;
45
esac
45
esac
46
 
46