Line 1... |
Line 1... |
1 |
#/bin/bash
|
1 |
#/bin/bash
|
2 |
# $Id: alcasar-conf.sh 1024 2013-02-06 01:29:13Z franck $
|
2 |
# $Id: alcasar-conf.sh 1050 2013-03-24 14:57:22Z 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 98... |
Line 98... |
98 |
then rm -f $DIR_UPDATE/etc/alcasar-uamdomain # un uamdomain 'vide' perturbe coova
|
98 |
then rm -f $DIR_UPDATE/etc/alcasar-uamdomain # un uamdomain 'vide' perturbe coova
|
99 |
fi
|
99 |
fi
|
100 |
fi
|
100 |
fi
|
101 |
else
|
101 |
else
|
102 |
# si version >= 2.1 : sauvegarde des certificats (serveur et CA)
|
102 |
# si version >= 2.1 : sauvegarde des certificats (serveur et CA)
|
103 |
mkdir $DIR_UPDATE/pki/
|
- |
|
104 |
cert_date=`/usr/bin/openssl x509 -noout -in /etc/pki/tls/certs/alcasar.crt -dates|grep After|cut -d"=" -f2`
|
103 |
cert_date=`/usr/bin/openssl x509 -noout -in /etc/pki/tls/certs/alcasar.crt -dates|grep After|cut -d"=" -f2`
|
105 |
cp -f /etc/pki/tls/certs/alcasar.crt $DIR_UPDATE
|
104 |
cp -f /etc/pki/tls/certs/alcasar.crt $DIR_UPDATE
|
106 |
cp -f /etc/pki/tls/private/alcasar.key $DIR_UPDATE
|
105 |
cp -f /etc/pki/tls/private/alcasar.key $DIR_UPDATE
|
107 |
cp -f /etc/pki/CA/alcasar-ca.crt $DIR_UPDATE
|
106 |
cp -f /etc/pki/CA/alcasar-ca.crt $DIR_UPDATE
|
108 |
cp -f /etc/pki/CA/private/alcasar-ca.key $DIR_UPDATE
|
107 |
cp -f /etc/pki/CA/private/alcasar-ca.key $DIR_UPDATE
|
Line 178... |
Line 177... |
178 |
else
|
177 |
else
|
179 |
echo "DNS_FILTERING=on" >> $CONF_FILE
|
178 |
echo "DNS_FILTERING=on" >> $CONF_FILE
|
180 |
fi
|
179 |
fi
|
181 |
fi
|
180 |
fi
|
182 |
# since V2.6
|
181 |
# since V2.6
|
183 |
# macallowed is replaced with macauth since
|
182 |
# macallowed is replaced with macauth
|
184 |
rm -f $DIR_UPDATE/etc/alcasar-macallowed
|
183 |
rm -f $DIR_UPDATE/etc/alcasar-macallowed
|
185 |
# DHCP mode can be "off/half/full"
|
184 |
# DHCP mode can be "off/half/full"
|
186 |
DHCP_mode=`cat $CONF_FILE|grep DHCP=|cut -d"=" -f2`
|
185 |
DHCP_mode=`cat $CONF_FILE|grep DHCP=|cut -d"=" -f2`
|
187 |
if [ $DHCP_mode = "on" ]; then
|
186 |
if [ $DHCP_mode = "on" ]; then
|
188 |
$SED "s?^DHCP=on.*?DHCP=full?" $CONF_FILE # DHCP option can be "off/half/full" since V2.6
|
187 |
$SED "s?^DHCP=on.*?DHCP=full?" $CONF_FILE # DHCP option can be "off/half/full" since V2.6
|
189 |
fi
|
188 |
fi
|
190 |
# le paramêtre 'EXT_LAN_FILTERING' n'existe plus
|
189 |
# The option 'EXT_LAN_FILTERING' is deleted
|
191 |
$SED "/^EXT_LAN/d" $CONF_FILE
|
190 |
$SED "/^EXT_LAN/d" $CONF_FILE
|
192 |
# la catégorie de sites filtrés "ip" n'existe plus
|
191 |
# The category "ip" no longer exist
|
193 |
$SED "/\/ip\/urls/d" $DIR_UPDATE/bannedurllist; $SED "/\/ip\/domains/d" $DIR_UPDATE/bannedsitelist
|
192 |
$SED "/\/ip\/urls/d" $DIR_UPDATE/bannedurllist; $SED "/\/ip\/domains/d" $DIR_UPDATE/bannedsitelist
|
194 |
$SED "/blacklists\/ip/d" $DIR_UPDATE/etc/alcasar-bl-categories; $SED "/^ip/d" $DIR_UPDATE/etc/alcasar-bl-categories-enabled
|
193 |
$SED "/blacklists\/ip/d" $DIR_UPDATE/etc/alcasar-bl-categories; $SED "/^ip/d" $DIR_UPDATE/etc/alcasar-bl-categories-enabled
|
195 |
# les bl et wl de dnsmasq sont reconstruites dynamiquement dans /usr/local/share
|
194 |
# BL and WL are now dynamically built in "/usr/local/share"
|
196 |
rm -rf $DIR_UPDATE/etc/alcasar-dnsfilter-enabled $DIR_UPDATE/etc/alcasar-dnsfilter-available
|
195 |
rm -rf $DIR_UPDATE/etc/alcasar-dnsfilter-enabled $DIR_UPDATE/etc/alcasar-dnsfilter-available
|
197 |
# bing et Youtube sont ajoutés au safesearching
|
196 |
# Bing et Youtube are addes to the safesearching system
|
198 |
Bing=`grep bing $DIR_UPDATE/urlregexplist | wc -l`
|
197 |
Bing=`grep bing $DIR_UPDATE/urlregexplist | wc -l`
|
199 |
if [ $Bing -ne "1" ]; then
|
198 |
if [ $Bing -ne "1" ]; then
|
200 |
SafeSearch=`grep ^\"\(\^http\:\/\/ $DIR_UPDATE/urlregexplist | wc -l`
|
199 |
SafeSearch=`grep ^\"\(\^http\:\/\/ $DIR_UPDATE/urlregexplist | wc -l`
|
201 |
if [ $SafeSearch -eq "0" ]; then
|
200 |
if [ $SafeSearch -eq "0" ]; then
|
202 |
cat <<EOF >> $DIR_UPDATE/urlregexplist
|
201 |
cat <<EOF >> $DIR_UPDATE/urlregexplist
|