/scripts/alcasar-activate-dnsfilter.sh |
---|
File deleted |
Property changes: |
Deleted: svn:eol-style |
-native |
\ No newline at end of property |
Deleted: svn:executable |
-* |
\ No newline at end of property |
Deleted: svn:keywords |
-Id Author Date |
\ No newline at end of property |
/scripts/alcasar-import-dnsfilter.sh |
---|
File deleted |
Property changes: |
Deleted: svn:eol-style |
-native |
\ No newline at end of property |
Deleted: svn:executable |
-* |
\ No newline at end of property |
Deleted: svn:keywords |
-Id Author Date |
\ No newline at end of property |
/scripts/alcasar-dnsfilter-import.sh |
---|
0,0 → 1,34 |
#!/bin/sh |
# $Id$ |
# Script d'import des blacklist activées dans /etc/dansguardian/lists/bannedsitelist |
TEMP="/tmp/fileFilter.txt" |
DIRDEST="/usr/local/etc/alcasar-dnsfilter-available" |
IPRETOUR="127.0.0.1" |
# Rechercher les domaines blacklistés |
find /etc/dansguardian/lists/blacklists -type f -name domains > $TEMP |
# Un peu de nettoyage auparavant ... |
sed -i "s?\/domains??g" $TEMP |
rm -f $DIRDEST/* |
for i in `cat $TEMP` |
do |
FIC=`basename $i` |
DIR=`dirname $i` |
# suppression des @IP et des lignes commentées par un '#' |
egrep -v "([0-9]{1,3}\.){3}[0-9]{1,3}" $i/domains | grep -v "^#"> /tmp/temp1 |
for f in `cat /tmp/temp1` |
do |
# remplacer les caractères bizarre comme les ô et û ö ü ... |
# |
echo "address=/$f/$IPRETOUR" >> $DIRDEST/dnsmasq-$FIC.conf |
done |
done |
exit 0 |
Property changes: |
Added: svn:eol-style |
+native |
\ No newline at end of property |
Added: svn:executable |
+* |
\ No newline at end of property |
Added: svn:keywords |
+Id Author Date |
\ No newline at end of property |
/scripts/alcasar-dnsfilter-activate.sh |
---|
0,0 → 1,24 |
#!/bin/sh |
# $Id$ |
# Script d'activation des blacklist activées dans /etc/dansguardian/lists/bannedsitelist |
TEMP="/tmp/fileFilter.txt" |
DIRAVAILABLE="/usr/local/etc/alcasar-dnsfilter-available" |
DIRENABLE="/usr/local/etc/alcasar-dnsfilter-enabled" |
# 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 $DIRENABLE/* |
for i in `cat $TEMP` |
do |
DOMAINE=`basename $i` |
ln -s $DIRAVAILABLE/dnsmasq-$DOMAINE.conf $DIRENABLE/ |
done |
exit 0 |
Property changes: |
Added: svn:eol-style |
+native |
\ No newline at end of property |
Added: svn:executable |
+* |
\ No newline at end of property |
Added: svn:keywords |
+Id Author Date |
\ No newline at end of property |