Subversion Repositories ALCASAR

Rev

Rev 393 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 393 Rev 518
1
#/bin/sh
1
#/bin/sh
2
# $Id: alcasar-havp.sh 393 2011-01-02 10:00:53Z franck $
2
# $Id: alcasar-havp.sh 518 2011-03-25 16:04:12Z stephane $
3
 
3
 
4
# alcasar-havp.sh
4
# alcasar-havp.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
# Gestion Havp / Clamav 
8
# Gestion Havp / Clamav 
9
 
-
 
10
SED="/bin/sed -i"
9
SED="/bin/sed -i"
11
usage="Usage: alcasar-havp.sh {--on or -on} | {--off or -off} | {--update or -update}"
10
usage="Usage: alcasar-havp.sh {--on or -on} | {--off or -off} | {--update or -update}"
12
nb_args=$#
11
nb_args=$#
13
args=$1
12
args=$1
14
if [ $nb_args -eq 0 ]
13
if [ $nb_args -eq 0 ]
15
then
14
then
16
	nb_args=1
15
	nb_args=1
17
	args="-h"
16
	args="-h"
18
fi
17
fi
19
case $args in
18
case $args in
20
	-\? | -h* | --h*)
19
	-\? | -h* | --h*)
21
		echo "$usage"
20
		echo "$usage"
22
		exit 0
21
		exit 0
23
		;;
22
		;;
24
	--on|-on)	
23
	--on|-on)	
25
		# activation havp
24
		# activation havp
26
		$SED "s/^proxyport =.*/proxyport = 8090/g" /etc/dansguardian/dansguardian.conf
25
		$SED "s/^proxyport =.*/proxyport = 8090/g" /etc/dansguardian/dansguardian.conf
27
		service dansguardian reload
26
		service dansguardian reload
28
		service havp start
27
		service havp start
29
		;;
28
		;;
30
	--off|-off)
29
	--off|-off)
31
		# désactivation du filtrage
30
		# désactivation du filtrage
32
		$SED "s/^proxyport =.*/proxyport = 3128/g" /etc/dansguardian/dansguardian.conf
31
		$SED "s/^proxyport =.*/proxyport = 3128/g" /etc/dansguardian/dansguardian.conf
33
		service dansguardian reload
32
		service dansguardian reload
34
		service havp stop
33
		service havp stop
35
		;;
34
		;;
36
	--update|-update)
35
	--update|-update)
37
		#mise à jour de la base de signature
36
		#mise à jour de la base de signature
38
		freshclam
37
		freshclam
39
		;;		
38
		;;		
40
	*)
39
	*)
41
		echo "Argument inconnu :$1";
40
		echo "Argument inconnu :$1";
42
		echo "$usage"
41
		echo "$usage"
43
		exit 1
42
		exit 1
44
		;;
43
		;;
45
esac
44
esac
46
 
45
 
47
 
46