Subversion Repositories ALCASAR

Rev

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

Rev 618 Rev 634
Line 1... Line 1...
1
#/bin/sh
1
#/bin/sh
2
# $Id: alcasar-nf.sh 618 2011-05-26 21:35:31Z richard $
2
# $Id: alcasar-nf.sh 634 2011-06-13 17:23:46Z richard $
3
 
3
 
4
# active ou desactive le filtrage de protocoles réseau
4
# active ou desactive le filtrage de protocoles réseau
5
# enable or disable the network protocols filter
5
# enable or disable the network protocols filter
6
# by rexy
6
# by rexy
7
 
7
 
8
SED="/bin/sed -i"
8
SED="/bin/sed -i"
9
FIC_SERVICES="/usr/local/etc/alcasar-services"
9
FIC_SERVICES="/usr/local/etc/alcasar-services"
10
FIC_EXCEPTIONS="/usr/local/etc/alcasar-filter-exceptions"
10
FIC_EXCEPTIONS="/usr/local/etc/alcasar-filter-exceptions"
11
FIC_CONF="/usr/local/etc/alcasar.conf"
11
FIC_CONF="/usr/local/etc/alcasar.conf"
12
 
12
 
13
usage="Usage: alcasar-nf.sh {--on | -on} | {--off | -off} | {-conf}"
13
usage="Usage: alcasar-nf.sh {--on | -on} | {--off | -off}"
14
nb_args=$#
14
nb_args=$#
15
args=$1
15
args=$1
16
if [ $nb_args -eq 0 ]
16
if [ $nb_args -eq 0 ]
17
then
17
then
18
	nb_args=1
18
	/usr/local/bin/alcasar-iptables.sh
19
	args="-h"
19
	exit 1
20
fi
20
fi
21
case $args in
21
case $args in
22
	-\? | -h* | --h*)
22
	-\? | -h* | --h*)
23
		echo "$usage"
23
		echo "$usage"
24
		exit 0
24
		exit 0
Line 39... Line 39...
39
		;;
39
		;;
40
	--off|-off) # disable protocols filter
40
	--off|-off) # disable protocols filter
41
		$SED "s?^PROTOCOLS_FILTERING.*?PROTOCOLS_FILTERING=off?g" $FIC_CONF
41
		$SED "s?^PROTOCOLS_FILTERING.*?PROTOCOLS_FILTERING=off?g" $FIC_CONF
42
		/usr/local/bin/alcasar-iptables.sh
42
		/usr/local/bin/alcasar-iptables.sh
43
		;;
43
		;;
44
	--conf|-conf)
-
 
45
		/usr/local/bin/alcasar-iptables.sh
-
 
46
		;;
-
 
47
	*)
44
	*)
48
		echo "Argument inconnu :$1";
45
		echo "Argument inconnu :$1";
49
		echo "$usage"
46
		echo "$usage"
50
		exit 1
47
		exit 1
51
		;;
48
		;;