Subversion Repositories ALCASAR

Rev

Rev 1056 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 1056 Rev 1827
Line 1... Line 1...
1
#/bin/bash
1
#/bin/bash
2
# $Id: alcasar-nf.sh 1056 2013-03-26 21:46:36Z stephane $
2
# $Id: alcasar-nf.sh 1827 2016-04-19 09:47:29Z raphael.pion $
3
 
3
 
4
# alcasar-nf.sh
4
# alcasar-nf.sh
5
# by Rexy
5
# by Rexy
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
 
8
# active ou desactive le filtrage de protocoles réseau
8
# active ou desactive le filtrage de protocoles réseau
9
# enable or disable the network protocols filter
9
# enable or disable the network protocols filter
10
 
10
 
11
SED="/bin/sed -i"
11
SED="/bin/sed -i"
12
FIC_CONF="/usr/local/etc/alcasar.conf"
12
CONF_FILE="/usr/local/etc/alcasar.conf"
13
 
13
 
14
usage="Usage: alcasar-nf.sh {--on | -on} | {--off | -off}"
14
usage="Usage: alcasar-nf.sh {--on | -on} | {--off | -off}"
15
nb_args=$#
15
nb_args=$#
16
args=$1
16
args=$1
17
if [ $nb_args -eq 0 ]
17
if [ $nb_args -eq 0 ]
Line 22... Line 22...
22
case $args in
22
case $args in
23
	-\? | -h* | --h*)
23
	-\? | -h* | --h*)
24
		echo "$usage"
24
		echo "$usage"
25
		exit 0
25
		exit 0
26
		;;
26
		;;
27
	-on|-on) # enable protocols filter
27
	--on|-on) # enable protocols filter
28
		$SED "s?^PROTOCOLS_FILTERING.*?PROTOCOLS_FILTERING=on?g" $FIC_CONF
28
		$SED "s?^PROTOCOLS_FILTERING.*?PROTOCOLS_FILTERING=on?g" $CONF_FILE
29
		/usr/local/bin/alcasar-iptables.sh
29
		/usr/local/bin/alcasar-iptables.sh
30
		;;
30
		;;
31
	--off|-off) # disable protocols filter
31
	--off|-off) # disable protocols filter
32
		$SED "s?^PROTOCOLS_FILTERING.*?PROTOCOLS_FILTERING=off?g" $FIC_CONF
32
		$SED "s?^PROTOCOLS_FILTERING.*?PROTOCOLS_FILTERING=off?g" $CONF_FILE
33
		/usr/local/bin/alcasar-iptables.sh
33
		/usr/local/bin/alcasar-iptables.sh
34
		;;
34
		;;
35
	*)
35
	*)
36
		echo "Argument inconnu :$1";
36
		echo "Argument inconnu :$1";
37
		echo "$usage"
37
		echo "$usage"