Subversion Repositories ALCASAR

Rev

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

Rev 247 Rev 393
Line 1... Line 1...
1
#/bin/sh
1
#/bin/sh
-
 
2
# $Id: alcasar-havp.sh 393 2011-01-02 10:00:53Z franck $
-
 
3
 
-
 
4
# alcasar-havp.sh
-
 
5
# by Rexy
-
 
6
# This script is distributed under the Gnu General Public License (GPL)
-
 
7
 
2
# Gestion Havp / Clamav 
8
# Gestion Havp / Clamav 
-
 
9
 
3
SED="/bin/sed -i"
10
SED="/bin/sed -i"
4
usage="Usage: alcasar-havp.sh -on | -off | -update"
11
usage="Usage: alcasar-havp.sh {--on or -on} | {--off or -off} | {--update or -update}"
5
nb_args=$#
12
nb_args=$#
6
args=$1
13
args=$1
7
if [ $nb_args -eq 0 ]
14
if [ $nb_args -eq 0 ]
8
then
15
then
9
	nb_args=1
16
	nb_args=1
Line 12... Line 19...
12
case $args in
19
case $args in
13
	-\? | -h* | --h*)
20
	-\? | -h* | --h*)
14
		echo "$usage"
21
		echo "$usage"
15
		exit 0
22
		exit 0
16
		;;
23
		;;
17
	-on)	
24
	--on|-on)	
18
		# activation havp
25
		# activation havp
19
		$SED "s/^proxyport =.*/proxyport = 8090/g" /etc/dansguardian/dansguardian.conf
26
		$SED "s/^proxyport =.*/proxyport = 8090/g" /etc/dansguardian/dansguardian.conf
20
		service dansguardian reload
27
		service dansguardian reload
21
		service havp start
28
		service havp start
22
		;;
29
		;;
23
	-off)
30
	--off|-off)
24
		# désactivation du filtrage
31
		# désactivation du filtrage
25
		$SED "s/^proxyport =.*/proxyport = 3128/g" /etc/dansguardian/dansguardian.conf
32
		$SED "s/^proxyport =.*/proxyport = 3128/g" /etc/dansguardian/dansguardian.conf
26
		service dansguardian reload
33
		service dansguardian reload
27
		service havp stop
34
		service havp stop
28
		;;
35
		;;
29
	-update)
36
	--update|-update)
30
		#mise à jour de la base de signature
37
		#mise à jour de la base de signature
31
		freshclam
38
		freshclam
32
		;;		
39
		;;		
33
	*)
40
	*)
34
		echo "Argument inconnu :$1";
41
		echo "Argument inconnu :$1";