Subversion Repositories ALCASAR

Rev

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

#!/bin/sh

#       $Id: alcasar-dnsfilter-activate.sh 260 2010-09-16 21:32:38Z richard $
# Script d'activation des blacklist activées dans /etc/dansguardian/lists/bannedsitelist

TEMP="/tmp/fileFilter.txt"
DIR_AVAILABLE="/usr/local/etc/alcasar-dnsfilter-available"
DIR_ENABLE="/usr/local/etc/alcasar-dnsfilter-enabled"
FILTERING=`cat /etc/dansguardian/dansguardian.conf|grep "reportinglevel ="|cut -d" " -f3`
# Rechercher les domaines blacklistés
egrep "^.Include.*domains>$" /etc/dansguardian/lists/bannedsitelist | cut -d"<" -f2 > $TEMP

# Un peu de nettoyage auparavant ...
sed -i "s?\/domains>??g" $TEMP
rm -f $DIR_ENABLE/*
if [ $FILTERING -eq "3" ]
then
        for i in `cat $TEMP`
        do
                DOMAINE=`basename $i`
                ln -s $DIR_AVAILABLE/$DOMAINE.conf $DIR_ENABLE/
        done
fi
exit 0