Line 1... |
Line 1... |
1 |
#/bin/sh
|
1 |
#/bin/sh
|
2 |
# $Id: alcasar-conf.sh 637 2011-06-16 21:56:59Z richard $
|
2 |
# $Id: alcasar-conf.sh 638 2011-06-18 21:19:04Z richard $
|
3 |
# $Author: richard $
|
3 |
# $Author: richard $
|
4 |
# by rexy
|
4 |
# by rexy
|
5 |
# Ce script permet de créer ou de charger l'archive des fichiers de configuration (/tmp/alcasar-conf.tar.gz)
|
5 |
# Ce script permet de créer ou de charger l'archive des fichiers de configuration (/tmp/alcasar-conf.tar.gz)
|
6 |
DIR_UPDATE="/tmp/conf" # répertoire de stockage des fichier de conf pour une mise à jour
|
6 |
DIR_UPDATE="/tmp/conf" # répertoire de stockage des fichier de conf pour une mise à jour
|
7 |
DIR_WEB="/var/www/html" # répertoire du centre de gestion
|
7 |
DIR_WEB="/var/www/html" # répertoire du centre de gestion
|
Line 80... |
Line 80... |
80 |
if [ $MAJ_RUNNING_VERSION -lt 2 ] || ([ $MAJ_RUNNING_VERSION -eq 2 ] && [ $MIN_RUNNING_VERSION -eq 0 ])
|
80 |
if [ $MAJ_RUNNING_VERSION -lt 2 ] || ([ $MAJ_RUNNING_VERSION -eq 2 ] && [ $MIN_RUNNING_VERSION -eq 0 ])
|
81 |
then
|
81 |
then
|
82 |
rm -f $DIR_UPDATE/etc/alcasar-dns-name # changement de format
|
82 |
rm -f $DIR_UPDATE/etc/alcasar-dns-name # changement de format
|
83 |
rm -f $DIR_UPDATE/etc/alcasar-macallowed # ajout d'un commentaire par @MAC
|
83 |
rm -f $DIR_UPDATE/etc/alcasar-macallowed # ajout d'un commentaire par @MAC
|
84 |
rm -rf $DIR_UPDATE/etc/digest # hostname=alcasar
|
84 |
rm -rf $DIR_UPDATE/etc/digest # hostname=alcasar
|
- |
|
85 |
if [ -e $DIR_UPDATE/etc/alcasar-uamallowed ]; then
|
85 |
uamallowed=`cat $DIR_UPDATE/etc/alcasar-uamallowed`
|
86 |
uamallowed=`cat $DIR_UPDATE/etc/alcasar-uamallowed`
|
86 |
if [ $uamallowed == "uamallowed=\"\"" ]
|
87 |
if [ $uamallowed == "uamallowed=\"\"" ]
|
87 |
then rm -f $DIR_UPDATE/etc/alcasar-uamallowed # un uamallowed 'vide' perturbe coova
|
88 |
then rm -f $DIR_UPDATE/etc/alcasar-uamallowed # un uamallowed 'vide' perturbe coova
|
- |
|
89 |
fi
|
88 |
fi
|
90 |
fi
|
- |
|
91 |
if [ -e $DIR_UPDATE/etc/alcasar-uamdomain ]; then
|
89 |
uamdomain=`cat $DIR_UPDATE/etc/alcasar-uamdomain`
|
92 |
uamdomain=`cat $DIR_UPDATE/etc/alcasar-uamdomain`
|
90 |
if [ $uamdomain == "uamdomain=\"\"" ]
|
93 |
if [ $uamdomain == "uamdomain=\"\"" ]
|
91 |
then rm -f $DIR_UPDATE/etc/alcasar-uamdomain # un uamdomain 'vide' perturbe coova
|
94 |
then rm -f $DIR_UPDATE/etc/alcasar-uamdomain # un uamdomain 'vide' perturbe coova
|
- |
|
95 |
fi
|
92 |
fi
|
96 |
fi
|
93 |
else
|
97 |
else
|
94 |
# si version >= 2.1 : sauvegarde des certificats (serveur et CA)
|
98 |
# si version >= 2.1 : sauvegarde des certificats (serveur et CA)
|
95 |
mkdir $DIR_UPDATE/pki/
|
99 |
mkdir $DIR_UPDATE/pki/
|
96 |
cert_date=`/usr/bin/openssl x509 -noout -in /etc/pki/tls/certs/alcasar.crt -dates|grep After|cut -d"=" -f2`
|
100 |
cert_date=`/usr/bin/openssl x509 -noout -in /etc/pki/tls/certs/alcasar.crt -dates|grep After|cut -d"=" -f2`
|
Line 145... |
Line 149... |
145 |
else
|
149 |
else
|
146 |
echo "LDAP=on" >> $CONF_FILE
|
150 |
echo "LDAP=on" >> $CONF_FILE
|
147 |
fi
|
151 |
fi
|
148 |
PROTOCOLS_FILTERING=`grep ^FILTERING /usr/local/bin/alcasar-iptables.sh | cut -d"=" -f2`
|
152 |
PROTOCOLS_FILTERING=`grep ^FILTERING /usr/local/bin/alcasar-iptables.sh | cut -d"=" -f2`
|
149 |
PROTOCOLS_FILTERING=${PROTOCOLS_FILTERING:="no"}
|
153 |
PROTOCOLS_FILTERING=${PROTOCOLS_FILTERING:="no"}
|
150 |
if [ $PROTOCOLS_FILTERING="no" ]; then
|
154 |
if [ $PROTOCOLS_FILTERING = "no" ]; then
|
151 |
echo "PROTOCOLS_FILTERING=off" >> $CONF_FILE
|
155 |
echo "PROTOCOLS_FILTERING=off" >> $CONF_FILE
|
152 |
else
|
156 |
else
|
153 |
echo "PROTOCOLS_FILTERING=on" >> $CONF_FILE
|
157 |
echo "PROTOCOLS_FILTERING=on" >> $CONF_FILE
|
154 |
fi
|
158 |
fi
|
155 |
WEB_FILTERING=`grep ^reportinglevel /etc/dansguardian/dansguardian.conf | cut -d"=" -f2 | tr -d " "`
|
159 |
DNS_FILTERING=`grep ^reportinglevel /etc/dansguardian/dansguardian.conf | cut -d"=" -f2 | tr -d " "`
|
156 |
DNS_FILTERING=${DNS_FILTERING:="-1"}
|
160 |
DNS_FILTERING=${DNS_FILTERING:="-1"}
|
157 |
if [ $DNS_FILTERING="-1" ]; then
|
161 |
if [ $DNS_FILTERING -eq "-1" ]; then
|
158 |
echo "DNS_FILTERING=off" >> $CONF_FILE
|
162 |
echo "DNS_FILTERING=off" >> $CONF_FILE
|
159 |
else
|
163 |
else
|
160 |
echo "DNS_FILTERING=on" >> $CONF_FILE
|
164 |
echo "DNS_FILTERING=on" >> $CONF_FILE
|
161 |
fi
|
165 |
fi
|
162 |
cp $CONF_FILE $DIR_UPDATE/etc/
|
166 |
cp $CONF_FILE $DIR_UPDATE/etc/
|