Subversion Repositories ALCASAR

Rev

Rev 40 | Go to most recent revision | Details | Last modification | View Log

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