Subversion Repositories ALCASAR

Rev

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

Rev 672 Rev 791
Line 1... Line 1...
1
#/bin/bash
1
#/bin/bash
2
# $Id: alcasar-nf.sh 672 2011-07-08 15:34:22Z richard $
2
# $Id: alcasar-nf.sh 791 2012-01-13 21:31:36Z richard $
3
 
3
 
4
# alcasar-nf.sh
4
# alcasar-nf.sh
5
# by Richard REY
5
# by 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 11... Line 11...
11
SED="/bin/sed -i"
11
SED="/bin/sed -i"
12
FIC_SERVICES="/usr/local/etc/alcasar-services"
12
FIC_SERVICES="/usr/local/etc/alcasar-services"
13
FIC_EXCEPTIONS="/usr/local/etc/alcasar-filter-exceptions"
13
FIC_EXCEPTIONS="/usr/local/etc/alcasar-filter-exceptions"
14
FIC_CONF="/usr/local/etc/alcasar.conf"
14
FIC_CONF="/usr/local/etc/alcasar.conf"
15
 
15
 
16
usage="Usage: alcasar-nf.sh {--on | -on} | {--off | -off}"
16
usage="Usage: alcasar-nf.sh {--on | -on} | {--off | -off} | {--lan_ext_filter_on | -lan_ext_filter_on} | {--lan_ext_filter_off | -lan_ext_filter_off}"
17
nb_args=$#
17
nb_args=$#
18
args=$1
18
args=$1
19
if [ $nb_args -eq 0 ]
19
if [ $nb_args -eq 0 ]
20
then
20
then
21
	/usr/local/bin/alcasar-iptables.sh
21
	/usr/local/bin/alcasar-iptables.sh
Line 42... Line 42...
42
		;;
42
		;;
43
	--off|-off) # disable protocols filter
43
	--off|-off) # disable protocols filter
44
		$SED "s?^PROTOCOLS_FILTERING.*?PROTOCOLS_FILTERING=off?g" $FIC_CONF
44
		$SED "s?^PROTOCOLS_FILTERING.*?PROTOCOLS_FILTERING=off?g" $FIC_CONF
45
		/usr/local/bin/alcasar-iptables.sh
45
		/usr/local/bin/alcasar-iptables.sh
46
		;;
46
		;;
-
 
47
	--lan_ext_filter_on|-lan_ext_filter_on) # allow external LAN access (LAN located between ALCASAR and the Internet gateway)
-
 
48
		$SED "s?^EXT_LAN_FILTERING.*?EXT_LAN_FILTERING=on?g" $FIC_CONF
-
 
49
		/usr/local/bin/alcasar-iptables.sh
-
 
50
		;;
-
 
51
	--lan_ext_filter_off|-lan_ext_filter_off) # allow external LAN access (LAN located between ALCASAR and the Internet gateway)
-
 
52
		$SED "s?^EXT_LAN_FILTERING.*?EXT_LAN_FILTERING=off?g" $FIC_CONF
-
 
53
		/usr/local/bin/alcasar-iptables.sh
-
 
54
		;;
47
	*)
55
	*)
48
		echo "Argument inconnu :$1";
56
		echo "Argument inconnu :$1";
49
		echo "$usage"
57
		echo "$usage"
50
		exit 1
58
		exit 1
51
		;;
59
		;;