Subversion Repositories ALCASAR

Rev

Go to most recent revision | Details | Last modification | View Log

Rev Author Line No. Line
650 richard 1
#/bin/sh
2
 
3
# alcasar-dg-pureip.sh
4
# by Yohan & Rexy
5
# This script is distributed under the Gnu General Public License (GPL)
6
 
7
# Gestion Dansguardian 
8
SED="/bin/sed -i"
9
function ip_disable (){
10
	$SED "s/^\*ip$/#*ip/g" /etc/dansguardian/lists/bannedsitelist
11
	service dansguardian reload
12
}
13
function ip_enable (){
14
	$SED "s/^\#\*ip$/*ip/g" /etc/dansguardian/lists/bannedsitelist
15
	service dansguardian reload
16
}
17
usage="Usage: alcasar-dg-pureip.sh {--on or -on} | {--off or -off} "
18
nb_args=$#
19
args=$1
20
if [ $nb_args -eq 0 ]
21
then
22
	nb_args=1
23
	args="-h"
24
fi
25
case $args in
26
	-\? | -h* | --h*)
27
		echo "$usage"
28
		exit 0
29
		;;
30
	--on|-on)	
31
		ip_enable
32
		;;
33
	--off|-off)
34
		ip_disable
35
		;;
36
	*)
37
		echo "Argument inconnu :$1";
38
		echo "$usage"
39
		exit 1
40
		;;
41
esac
42