Line 1... |
Line 1... |
1 |
#!/bin/sh
|
1 |
#!/bin/sh
|
2 |
# $Id: alcasar.sh 303 2010-10-09 16:41:23Z richard $
|
2 |
# $Id: alcasar.sh 304 2010-10-10 21:12:15Z richard $
|
3 |
|
3 |
|
4 |
# alcasar.sh
|
4 |
# alcasar.sh
|
5 |
# by Franck BOUIJOUX, Pascal LEVANT and Richard REY
|
5 |
# by Franck BOUIJOUX, Pascal LEVANT and Richard REY
|
6 |
# This script is distributed under the Gnu General Public License (GPL)
|
6 |
# This script is distributed under the Gnu General Public License (GPL)
|
7 |
|
7 |
|
Line 916... |
Line 916... |
916 |
# On crée une WhiteList vide
|
916 |
# On crée une WhiteList vide
|
917 |
[ -e /etc/dansguardian/lists/exceptionsitelist.default ] || mv /etc/dansguardian/lists/exceptionsitelist /etc/dansguardian/lists/exceptionsitelist.default
|
917 |
[ -e /etc/dansguardian/lists/exceptionsitelist.default ] || mv /etc/dansguardian/lists/exceptionsitelist /etc/dansguardian/lists/exceptionsitelist.default
|
918 |
[ -e /etc/dansguardian/lists/exceptionurllist.default ] || mv /etc/dansguardian/lists/exceptionurllist /etc/dansguardian/lists/exceptionurllist.default
|
918 |
[ -e /etc/dansguardian/lists/exceptionurllist.default ] || mv /etc/dansguardian/lists/exceptionurllist /etc/dansguardian/lists/exceptionurllist.default
|
919 |
touch /etc/dansguardian/lists/exceptionsitelist
|
919 |
touch /etc/dansguardian/lists/exceptionsitelist
|
920 |
touch /etc/dansguardian/lists/exceptionurllist
|
920 |
touch /etc/dansguardian/lists/exceptionurllist
|
921 |
# on configure le filtrage de site
|
921 |
# on configure le filtrage de site WEB
|
922 |
[ -e /etc/dansguardian/lists/bannedsitelist.default ] || cp /etc/dansguardian/lists/bannedsitelist /etc/dansguardian/lists/bannedsitelist.default
|
922 |
[ -e /etc/dansguardian/lists/bannedsitelist.default ] || cp /etc/dansguardian/lists/bannedsitelist /etc/dansguardian/lists/bannedsitelist.default
|
923 |
$SED "s?^[^#]?#&?g" /etc/dansguardian/lists/bannedsitelist # (on commente ce qui ne l'est pas)
|
923 |
$SED "s?^[^#]?#&?g" /etc/dansguardian/lists/bannedsitelist # (on commente ce qui ne l'est pas)
|
924 |
# on bloque les sites ne possédant pas de nom de domaine (ex: http://12.13.14.15)
|
924 |
# on bloque les sites ne possédant pas de nom de domaine (ex: http://12.13.14.15)
|
925 |
$SED "s?^#\*ip?\*ip?g" /etc/dansguardian/lists/bannedsitelist
|
925 |
$SED "s?^#\*ip?\*ip?g" /etc/dansguardian/lists/bannedsitelist
|
926 |
# on bloque le ssl sur port 80
|
926 |
# on bloque le ssl sur port 80
|
927 |
$SED "s?^#\*\*s?\*\*s?g" /etc/dansguardian/lists/bannedsitelist
|
927 |
$SED "s?^#\*\*s?\*\*s?g" /etc/dansguardian/lists/bannedsitelist
|
928 |
# on configure la BL de toulouse
|
- |
|
929 |
cat $DIR_CONF/bannedsitelist >> /etc/dansguardian/lists/bannedsitelist
|
928 |
# (pris en compte par dnsmasq) cat $DIR_CONF/bannedsitelist >> /etc/dansguardian/lists/bannedsitelist
|
- |
|
929 |
# on configure le filtrage d'url
|
930 |
[ -e /etc/dansguardian/lists/bannedurllist.default ] || cp /etc/dansguardian/lists/bannedurllist /etc/dansguardian/lists/bannedurllist.default
|
930 |
[ -e /etc/dansguardian/lists/bannedurllist.default ] || cp /etc/dansguardian/lists/bannedurllist /etc/dansguardian/lists/bannedurllist.default
|
931 |
$SED "s?^[^#]?#&?g" /etc/dansguardian/lists/bannedurllist # (on commente ce qui ne l'est pas)
|
931 |
$SED "s?^[^#]?#&?g" /etc/dansguardian/lists/bannedurllist # (on commente ce qui ne l'est pas)
|
932 |
cat $DIR_CONF/bannedurllist >> /etc/dansguardian/lists/bannedurllist
|
932 |
cat $DIR_CONF/bannedurllist >> /etc/dansguardian/lists/bannedurllist
|
933 |
chown -R dansguardian:apache /etc/dansguardian/
|
933 |
chown -R dansguardian:apache /etc/dansguardian/
|
934 |
chmod -R g+rw /etc/dansguardian
|
934 |
chmod -R g+rw /etc/dansguardian
|
Line 1064... |
Line 1064... |
1064 |
#dhcp-option=option:ntp-server,192.168.0.4,10.10.0.5
|
1064 |
#dhcp-option=option:ntp-server,192.168.0.4,10.10.0.5
|
1065 |
|
1065 |
|
1066 |
# Exemple de configuration statique : <@MAC>,<name>,<@IP>,<MASK>,<ttl bail>
|
1066 |
# Exemple de configuration statique : <@MAC>,<name>,<@IP>,<MASK>,<ttl bail>
|
1067 |
#dhcp-host=11:22:33:44:55:66,ssic-test,192.168.10.20,255.255.255.0,45m
|
1067 |
#dhcp-host=11:22:33:44:55:66,ssic-test,192.168.10.20,255.255.255.0,45m
|
1068 |
EOF
|
1068 |
EOF
|
- |
|
1069 |
# On crée la structure du DNS-blackhole :
|
- |
|
1070 |
# - import des domaines de la BL Toulouse dans /usr/local/etc/alcasar-dns-availabled (1 fichier par domaine)
|
- |
|
1071 |
# - lien symbolique de ces fichiers dans /usr/local/etc/alcasar-dns-enabled pour activation/désactivation
|
1069 |
mkdir /usr/local/etc/{alcasar-dnsfilter-available,alcasar-dnsfilter-enabled}
|
1072 |
mkdir /usr/local/etc/{alcasar-dnsfilter-available,alcasar-dnsfilter-enabled}
|
1070 |
chown -R 770 /usr/local/etc/{alcasar-dnsfilter-available,alcasar-dnsfilter-enabled}
|
1073 |
chown -R 770 /usr/local/etc/{alcasar-dnsfilter-available,alcasar-dnsfilter-enabled}
|
1071 |
chown -R root:apache /usr/local/etc/{alcasar-dnsfilter-available,alcasar-dnsfilter-enabled}
|
1074 |
chown -R root:apache /usr/local/etc/{alcasar-dnsfilter-available,alcasar-dnsfilter-enabled}
|
- |
|
1075 |
$SED "s?^IP_RETOUR=.*?IP_RETOUR=\"$PRIVATE_IP\"?g" /usr/local/bin/alcasar-dnsfilter-import.sh
|
1072 |
/usr/local/bin/alcasar-dnsfilter-import.sh
|
1076 |
/usr/local/bin/alcasar-dnsfilter-import.sh
|
1073 |
/usr/local/bin/alcasar-dnsfilter-activate.sh
|
1077 |
/usr/local/bin/alcasar-dnsfilter-activate.sh
|
1074 |
} # End dnsmasq
|
1078 |
} # End dnsmasq
|
1075 |
|
1079 |
|
1076 |
##########################################################
|
1080 |
##########################################################
|