Subversion Repositories ALCASAR

Rev

Rev 519 | Go to most recent revision | Blame | Last modification | View Log

#/bin/sh
# $Id: alcasar-havp.sh 612 2011-05-22 21:19:27Z richard $

# alcasar-havp.sh
# by Rexy
# This script is distributed under the Gnu General Public License (GPL)

# Gestion Havp / Clamav 
SED="/bin/sed -i"
usage="Usage: alcasar-havp.sh {--on or -on} | {--off or -off} | {--update or -update}"
nb_args=$#
args=$1
if [ $nb_args -eq 0 ]
then
        nb_args=1
        args="-h"
fi
case $args in
        -\? | -h* | --h*)
                echo "$usage"
                exit 0
                ;;
        --on|-on)       
                # activation havp
                $SED "s/^proxyport =.*/proxyport = 8090/g" /etc/dansguardian/dansguardian.conf
                $SED "s/^WEB_ANTIVIRUS=.*/WEB_ANTIVIRUS=on/g" /usr/local/etc/alcasar.conf
                service dansguardian reload
                service havp start
                ;;
        --off|-off)
                # désactivation du filtrage
                $SED "s/^proxyport =.*/proxyport = 3128/g" /etc/dansguardian/dansguardian.conf
                $SED "s/^WEB_ANTIVIRUS=.*/WEB_ANTIVIRUS=off/g" /usr/local/etc/alcasar.conf
                service dansguardian reload
                service havp stop
                ;;
        --update|-update)
                #mise à jour de la base de signature
                freshclam
                ;;              
        *)
                echo "Argument inconnu :$1";
                echo "$usage"
                exit 1
                ;;
esac