Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 633 → Rev 634

/scripts/sbin/alcasar-bl.sh
13,7 → 13,7
BL_CATEGORIES_ENABLED="/usr/local/etc/alcasar-bl-categories-enabled"
DIR_DNS_FILTER_AVAILABLE="/usr/local/etc/alcasar-dnsfilter-available"
DIR_DNS_FILTER_ENABLED="/usr/local/etc/alcasar-dnsfilter-enabled"
IP_RETOUR="192.168.182.1"
IP_RETOUR="20.0.0.1"
BL_SERVER="cri.univ-tlse1.fr"
SED="/bin/sed -i"
# Récupération de l'archive de la BL Toulouse
102,16 → 102,25
if [ "$PARENT_SCRIPT" != "/usr/local/bin/alcasar-conf.sh" ] # don't launch on install stage
then
service dansguardian restart
service dnsmasq restart
/usr/local/bin/alcasar-iptables.sh
fi
}
usage="Usage: alcasar-bl.sh {-on or --on} | { -off or --off } | { -download or --download } | { -reload or --reload } | { -conf or --conf}"
usage="Usage: alcasar-bl.sh {-on or --on} | { -off or --off } | { -download or --download } | { -reload or --reload }"
nb_args=$#
args=$1
if [ $nb_args -eq 0 ]
then
nb_args=1
args="-h"
DNS_FILTERING=`grep DNS_FILTERING $CONF_FILE|cut -d"=" -f2` # DNS and URLs filter (on/off)
DNS_FILTERING=${DNS_FILTERING:=off}
echo "Set BlackList Filtering to $DNS_FILTERING"
if [ $DNS_FILTERING = on ]; then
cat_choice
bl_enable
else
bl_disable
fi
exit 0
fi
case $args in
-\? | -h* | --h*)
129,16 → 138,6
$SED "s?^DNS_FILTERING.*?DNS_FILTERING=off?g" $CONF_FILE
bl_disable
;;
-conf | --conf)
DNS_FILTERING=`grep DNS_FILTERING $CONF_FILE|cut -d"=" -f2` # DNS and URLs filter (on/off)
DNS_FILTERING=${DNS_FILTERING:=off}
if [ $DNS_FILTERING = on ]; then
cat_choice
bl_enable
else
bl_disable
fi
;;
# Mise a jour de la blacklist 'Toulouse' et adaptation à dansguardian et dnsmasq
-download | --download)
rm -rf /tmp/con_ok.html
164,7 → 163,6
chown -R dansguardian:apache $DIR_DG_BL/ossi
chmod -R g+w $DIR_DG_BL/ossi
cat_choice
service dansguardian restart
# pour dnsmasq (noms de domaine réhabilités)
if [ `wc -w $DIR_DG/exceptionsitelist|cut -d " " -f1` != "0" ]
then
175,7 → 173,13
fi
cp -f $DIR_DG_BL/ossi/domains $DIR_DNS_FILTER_AVAILABLE/ossi.conf
$SED "s?.*?address=/&/$IP_RETOUR?g" $DIR_DNS_FILTER_AVAILABLE/ossi.conf
service dnsmasq restart
DNS_FILTERING=`grep DNS_FILTERING $CONF_FILE|cut -d"=" -f2` # DNS and URLs filter (on/off)
DNS_FILTERING=${DNS_FILTERING:=off}
if [ $DNS_FILTERING = on ]; then
bl_enable
else
bl_disable
fi
;;
*)
echo "Argument inconnu :$1";