2,7 → 2,7 |
# $Id$ |
|
# alcasar-havp.sh |
# by Richard REY |
# by Rexy |
# This script is distributed under the Gnu General Public License (GPL) |
|
# Activation / désactivation antivirus de flux WEB (Havp + LibClamav) |
11,15 → 11,17 |
CONF_FILE="/usr/local/etc/alcasar.conf" |
SED="/bin/sed -i" |
function av_disable (){ |
$SED "s/^proxyport =.*/proxyport = 3128/g" /etc/dansguardian/dansguardian.conf |
$SED "s/^cache_peer.*/#cache_peer 127\.0\.0\.1 parent 8090 0 no-query default/g" /etc/squid/squid.conf |
$SED "s/^never_direct.*/#never_direct allow all/g" /etc/squid/squid.conf |
$SED "s/^WEB_ANTIVIRUS=.*/WEB_ANTIVIRUS=off/g" /usr/local/etc/alcasar.conf |
service dansguardian reload |
service squid reload |
service havp stop |
} |
function av_enable (){ |
$SED "s/^proxyport =.*/proxyport = 8090/g" /etc/dansguardian/dansguardian.conf |
$SED "s/^#cache_peer.*/cache_peer 127\.0\.0\.1 parent 8090 0 no-query default/g" /etc/squid/squid.conf |
$SED "s/^#never_direct.*/never_direct allow all/g" /etc/squid/squid.conf |
$SED "s/^WEB_ANTIVIRUS=.*/WEB_ANTIVIRUS=on/g" /usr/local/etc/alcasar.conf |
service dansguardian reload |
service squid reload |
service havp start |
} |
usage="Usage: alcasar-havp.sh {--on or -on} | {--off or -off} | {--update or -update}" |
27,7 → 29,7 |
args=$1 |
if [ $nb_args -eq 0 ] |
then |
AV_FILTERING=`grep WEB_ANTIVIRUS $CONF_FILE|cut -d"=" -f2` # DNS and URLs filter (on/off) |
AV_FILTERING=`grep WEB_ANTIVIRUS $CONF_FILE|cut -d"=" -f2` # WEB-antivir (on/off) |
AV_FILTERING=${AV_FILTERING:=on} |
echo "Set antivirus Filtering to $AV_FILTERING" |
if [ $AV_FILTERING = on ]; then |