Subversion Repositories ALCASAR

Rev

Details | Last modification | View Log

Rev Author Line No. Line
672 richard 1
#/bin/bash
63 franck 2
# $Id: alcasar-nf.sh 1056 2013-03-26 21:46:36Z stephane $
3
 
672 richard 4
# alcasar-nf.sh
859 richard 5
# by Rexy
672 richard 6
# This script is distributed under the Gnu General Public License (GPL)
7
 
520 richard 8
# active ou desactive le filtrage de protocoles réseau
9
# enable or disable the network protocols filter
10
 
1 root 11
SED="/bin/sed -i"
612 richard 12
FIC_CONF="/usr/local/etc/alcasar.conf"
1 root 13
 
859 richard 14
usage="Usage: alcasar-nf.sh {--on | -on} | {--off | -off}"
1 root 15
nb_args=$#
16
args=$1
17
if [ $nb_args -eq 0 ]
18
then
859 richard 19
	echo $usage
634 richard 20
	exit 1
1 root 21
fi
22
case $args in
23
	-\? | -h* | --h*)
24
		echo "$usage"
25
		exit 0
26
		;;
615 richard 27
	-on|-on) # enable protocols filter
28
		$SED "s?^PROTOCOLS_FILTERING.*?PROTOCOLS_FILTERING=on?g" $FIC_CONF
1 root 29
		/usr/local/bin/alcasar-iptables.sh
30
		;;
615 richard 31
	--off|-off) # disable protocols filter
612 richard 32
		$SED "s?^PROTOCOLS_FILTERING.*?PROTOCOLS_FILTERING=off?g" $FIC_CONF
1 root 33
		/usr/local/bin/alcasar-iptables.sh
34
		;;
35
	*)
36
		echo "Argument inconnu :$1";
37
		echo "$usage"
38
		exit 1
39
		;;
40
esac
41