Line 1... |
Line 1... |
1 |
#/bin/bash
|
1 |
#/bin/bash
|
2 |
# $Id: alcasar-conf.sh 958 2012-07-19 09:01:30Z franck $
|
2 |
# $Id: alcasar-conf.sh 977 2012-08-15 17:32:25Z richard $
|
3 |
|
3 |
|
4 |
# alcasar-conf.sh
|
4 |
# alcasar-conf.sh
|
5 |
# by REXY
|
5 |
# by REXY
|
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 75... |
Line 75... |
75 |
cp -rf /etc/dansguardian/lists/blacklists/ossi $DIR_UPDATE
|
75 |
cp -rf /etc/dansguardian/lists/blacklists/ossi $DIR_UPDATE
|
76 |
# sauvegarde des fichiers : de conf, de filtrage, d'exception, digest, etc.
|
76 |
# sauvegarde des fichiers : de conf, de filtrage, d'exception, digest, etc.
|
77 |
mkdir $DIR_UPDATE/etc/
|
77 |
mkdir $DIR_UPDATE/etc/
|
78 |
cp -rf $DIR_ETC/* $DIR_UPDATE/etc/
|
78 |
cp -rf $DIR_ETC/* $DIR_UPDATE/etc/
|
79 |
# particularité des versions
|
79 |
# particularité des versions
|
80 |
rm -f $DIR_UPDATE/etc/alcasar-macallowed # macallowed is replaced with macauth
|
- |
|
81 |
# si version <= 2.0
|
80 |
# si version <= 2.0
|
82 |
if [ $MAJ_RUNNING_VERSION -lt 2 ] || ([ $MAJ_RUNNING_VERSION -eq 2 ] && [ $MIN_RUNNING_VERSION -eq 0 ])
|
81 |
if [ $MAJ_RUNNING_VERSION -lt 2 ] || ([ $MAJ_RUNNING_VERSION -eq 2 ] && [ $MIN_RUNNING_VERSION -eq 0 ])
|
83 |
then
|
82 |
then
|
84 |
rm -f $DIR_UPDATE/etc/alcasar-dns-name # changement de format
|
83 |
rm -f $DIR_UPDATE/etc/alcasar-dns-name # changement de format
|
85 |
rm -rf $DIR_UPDATE/etc/digest # hostname=alcasar
|
84 |
rm -rf $DIR_UPDATE/etc/digest # hostname=alcasar
|
Line 174... |
Line 173... |
174 |
echo "DNS_FILTERING=off" >> $CONF_FILE
|
173 |
echo "DNS_FILTERING=off" >> $CONF_FILE
|
175 |
else
|
174 |
else
|
176 |
echo "DNS_FILTERING=on" >> $CONF_FILE
|
175 |
echo "DNS_FILTERING=on" >> $CONF_FILE
|
177 |
fi
|
176 |
fi
|
178 |
fi
|
177 |
fi
|
- |
|
178 |
# since V2.6
|
- |
|
179 |
# macallowed is replaced with macauth since
|
- |
|
180 |
rm -f $DIR_UPDATE/etc/alcasar-macallowed
|
179 |
# DHCP mode can be "off/half/full" since V2.6
|
181 |
# DHCP mode can be "off/half/full"
|
180 |
DHCP_mode=`cat $CONF_FILE|grep DHCP=|cut -d"=" -f2`
|
182 |
DHCP_mode=`cat $CONF_FILE|grep DHCP=|cut -d"=" -f2`
|
181 |
if [ $DHCP_mode = "on" ]; then
|
183 |
if [ $DHCP_mode = "on" ]; then
|
182 |
$SED "s?^DHCP=on.*?DHCP=full?" $CONF_FILE # DHCP option can be "off/half/full" since V2.6
|
184 |
$SED "s?^DHCP=on.*?DHCP=full?" $CONF_FILE # DHCP option can be "off/half/full" since V2.6
|
183 |
fi
|
185 |
fi
|
184 |
# le paramêtre 'EXT_LAN_FILTERING' n'existe plus depuis la V2.6
|
186 |
# le paramêtre 'EXT_LAN_FILTERING' n'existe plus
|
185 |
$SED "/^EXT_LAN/d" $CONF_FILE
|
187 |
$SED "/^EXT_LAN/d" $CONF_FILE
|
186 |
# la catégorie de sites filtrés "ip" n'existe plus depuis la V2.6
|
188 |
# la catégorie de sites filtrés "ip" n'existe plus
|
187 |
$SED "/\/ip\/urls/d" $DIR_UPDATE/bannedurllist; $SED "/\/ip\/domains/d" $DIR_UPDATE/bannedsitelist
|
189 |
$SED "/\/ip\/urls/d" $DIR_UPDATE/bannedurllist; $SED "/\/ip\/domains/d" $DIR_UPDATE/bannedsitelist
|
188 |
$SED "/blacklists\/ip/d" $DIR_UPDATE/etc/alcasar-bl-categories; $SED "/^ip/d" $DIR_UPDATE/etc/alcasar-bl-categories-enabled
|
190 |
$SED "/blacklists\/ip/d" $DIR_UPDATE/etc/alcasar-bl-categories; $SED "/^ip/d" $DIR_UPDATE/etc/alcasar-bl-categories-enabled
|
189 |
# bing et Youtube sont ajoutés au safesearching depuis la V2.6
|
191 |
# bing et Youtube sont ajoutés au safesearching
|
190 |
Bing=`grep bing $DIR_UPDATE/urlregexplist | wc -l`
|
192 |
Bing=`grep bing $DIR_UPDATE/urlregexplist | wc -l`
|
191 |
if [ $Bing -ne "1" ]; then
|
193 |
if [ $Bing -ne "1" ]; then
|
192 |
SafeSearch=`grep ^\"\(\^http\:\/\/ $DIR_UPDATE/urlregexplist | wc -l`
|
194 |
SafeSearch=`grep ^\"\(\^http\:\/\/ $DIR_UPDATE/urlregexplist | wc -l`
|
193 |
if [ $SafeSearch -eq "0" ]; then
|
195 |
if [ $SafeSearch -eq "0" ]; then
|
194 |
cat <<EOF >> $DIR_UPDATE/urlregexplist
|
196 |
cat <<EOF >> $DIR_UPDATE/urlregexplist
|
Line 204... |
Line 206... |
204 |
# Youtube - add 'edufilter=your_ID'
|
206 |
# Youtube - add 'edufilter=your_ID'
|
205 |
"(^http://[0-9a-z]+\.youtube\.[a-z]+[-/%.0-9a-z]*\?)(.*)"->"\1\2&edufilter=ABCD1234567890abcdef"
|
207 |
"(^http://[0-9a-z]+\.youtube\.[a-z]+[-/%.0-9a-z]*\?)(.*)"->"\1\2&edufilter=ABCD1234567890abcdef"
|
206 |
EOF
|
208 |
EOF
|
207 |
fi
|
209 |
fi
|
208 |
fi
|
210 |
fi
|
209 |
# la variable YOUTUBE_ID est déclarée dans le fichier de conf depuis la V2.6
|
211 |
# la variable YOUTUBE_ID est déclarée dans le fichier de conf
|
210 |
YOUTUBE_ID=`grep ^YOUTUBE_ID $CONF_FILE | cut -d"=" -f2`
|
212 |
YOUTUBE_ID=`grep ^YOUTUBE_ID $CONF_FILE | cut -d"=" -f2`
|
211 |
YOUTUBE_ID=${YOUTUBE_ID:="-1"}
|
213 |
YOUTUBE_ID=${YOUTUBE_ID:="-1"}
|
212 |
if [ $YOUTUBE_ID = "-1" ]; then
|
214 |
if [ $YOUTUBE_ID = "-1" ]; then
|
213 |
echo "YOUTUBE_ID=ABCD1234567890abcdef" >> $CONF_FILE
|
215 |
echo "YOUTUBE_ID=ABCD1234567890abcdef" >> $CONF_FILE
|
214 |
fi
|
216 |
fi
|