Subversion Repositories ALCASAR

Rev

Details | Last modification | View Log

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