/scripts/sbin/alcasar-nf.sh |
---|
10,13 → 10,13 |
FIC_EXCEPTIONS="/usr/local/etc/alcasar-filter-exceptions" |
FIC_CONF="/usr/local/etc/alcasar.conf" |
usage="Usage: alcasar-nf.sh {--on | -on} | {--off | -off} | {-conf}" |
usage="Usage: alcasar-nf.sh {--on | -on} | {--off | -off}" |
nb_args=$# |
args=$1 |
if [ $nb_args -eq 0 ] |
then |
nb_args=1 |
args="-h" |
/usr/local/bin/alcasar-iptables.sh |
exit 1 |
fi |
case $args in |
-\? | -h* | --h*) |
41,9 → 41,6 |
$SED "s?^PROTOCOLS_FILTERING.*?PROTOCOLS_FILTERING=off?g" $FIC_CONF |
/usr/local/bin/alcasar-iptables.sh |
;; |
--conf|-conf) |
/usr/local/bin/alcasar-iptables.sh |
;; |
*) |
echo "Argument inconnu :$1"; |
echo "$usage" |
/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"; |
/scripts/sbin/alcasar-havp.sh |
---|
6,14 → 6,34 |
# This script is distributed under the Gnu General Public License (GPL) |
# Gestion Havp / Clamav |
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/^WEB_ANTIVIRUS=.*/WEB_ANTIVIRUS=off/g" /usr/local/etc/alcasar.conf |
service dansguardian reload |
service havp stop |
} |
function av_enable (){ |
$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 |
} |
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" |
AV_FILTERING=`grep WEB_ANTIVIRUS $CONF_FILE|cut -d"=" -f2` # DNS and URLs filter (on/off) |
AV_FILTERING=${AV_FILTERING:=on} |
echo "Set antivirus Filtering to $AV_FILTERING" |
if [ $AV_FILTERING = on ]; then |
av_enable |
else |
av_disable |
fi |
exit 0 |
fi |
case $args in |
-\? | -h* | --h*) |
21,18 → 41,10 |
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 |
av_enable |
;; |
--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 |
av_disable |
;; |
--update|-update) |
#mise à jour de la base de signature |