Subversion Repositories ALCASAR

Rev

Rev 493 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log

Rev Author Line No. Line
672 richard 1
#/bin/bash
493 franck 2
# $Id: alcasar-qos.sh 672 2011-07-08 15:34:22Z richard $
3
 
672 richard 4
# alcasar-CA.sh
5
# by Franck BOUIJOUX
6
# This script is distributed under the Gnu General Public License (GPL)
493 franck 7
 
672 richard 8
# Active / désactive la qualite de service réseau
9
# Enable / disable QOS
10
 
493 franck 11
SED="/bin/sed -i"
12
FIC_QOS="/usr/local/etc/alcasar-iptables-qos.sh"
13
 
14
usage="Usage: alcasar-qos.sh {--on or -on} | {--off | -off} "
15
nb_args=$#
16
args=$1
17
if [ $nb_args -eq 0 ]
18
then
19
	nb_args=1
20
	args="-h"
21
fi
22
case $args in
23
	-\? | -h* | --h*)
24
		echo "$usage"
25
		exit 0
26
		;;
27
	--on|-on)	
28
		# activation du filtrage réseau
29
		if [ -e $FIC_QOS ] then 
30
			$SED "s?^QOS.*?QOS=\"yes\"?g" /usr/local/bin/alcasar-iptables.sh
31
		/usr/local/bin/alcasar-iptables.sh
32
		else	
33
			exit 2
34
		fi
35
		;;
36
	--off|-off)
37
		# désactivation du filtrage réseau
38
		$SED "s?^QOS.*?QOS=\"no\"?g" /usr/local/bin/alcasar-iptables.sh
39
		/usr/local/bin/alcasar-iptables.sh
40
		;;
41
	*)
42
		echo "Argument inconnu :$1";
43
		echo "$usage"
44
		exit 1
45
		;;
46
esac
47