Subversion Repositories ALCASAR

Rev

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

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