Line 1... |
Line 1... |
1 |
#/bin/bash
|
1 |
#/bin/bash
|
2 |
# $Id: alcasar-conf.sh 1918 2016-06-01 14:49:47Z franck $
|
2 |
# $Id: alcasar-conf.sh 1946 2016-06-14 22:06:24Z 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 18... |
Line 18... |
18 |
fichier="alcasar-conf-$new.tar.gz" # nom du fichier de sauvegarde
|
18 |
fichier="alcasar-conf-$new.tar.gz" # nom du fichier de sauvegarde
|
19 |
DIR_UPDATE="/tmp/conf" # répertoire de stockage des fichier de conf pour une mise à jour
|
19 |
DIR_UPDATE="/tmp/conf" # répertoire de stockage des fichier de conf pour une mise à jour
|
20 |
DIR_WEB="/var/www/html" # répertoire du centre de gestion
|
20 |
DIR_WEB="/var/www/html" # répertoire du centre de gestion
|
21 |
DIR_BIN="/usr/local/bin" # répertoire des scripts d'admin
|
21 |
DIR_BIN="/usr/local/bin" # répertoire des scripts d'admin
|
22 |
DIR_ETC="/usr/local/etc" # répertoire des fichiers de conf
|
22 |
DIR_ETC="/usr/local/etc" # répertoire des fichiers de conf
|
23 |
DIR_SHARE="/usr/local/share" # répertoire des fichiers partagés
|
23 |
DIR_BLACKLIST="/etc/dansguardian/lists/blacklists" # répertoire de la BL de Toulouse
|
24 |
CONF_FILE="$DIR_ETC/alcasar.conf" # main alcasar conf file
|
24 |
CONF_FILE="$DIR_ETC/alcasar.conf" # main alcasar conf file
|
25 |
VERSION="/var/www/html/VERSION" # contient la version en cours
|
25 |
VERSION="/var/www/html/VERSION" # contient la version en cours
|
26 |
EXTIF=`grep ^EXTIF= $CONF_FILE|cut -d"=" -f2` # EXTernal InterFace
|
26 |
EXTIF=`grep ^EXTIF= $CONF_FILE|cut -d"=" -f2` # EXTernal InterFace
|
27 |
INTIF=`grep ^INTIF= $CONF_FILE|cut -d"=" -f2` # INTernal InterFace
|
27 |
INTIF=`grep ^INTIF= $CONF_FILE|cut -d"=" -f2` # INTernal InterFace
|
28 |
MTU=`grep ^PUBLIC_MTU= $CONF_FILE|cut -d"=" -f2` # INTernal InterFace
|
28 |
MTU=`grep ^PUBLIC_MTU= $CONF_FILE|cut -d"=" -f2` # INTernal InterFace
|
Line 87... |
Line 87... |
87 |
cp -f /etc/dansguardian/lists/urlregexplist $DIR_UPDATE/custom_bl/
|
87 |
cp -f /etc/dansguardian/lists/urlregexplist $DIR_UPDATE/custom_bl/
|
88 |
cp -f /etc/dansguardian/lists/exceptionsitelist $DIR_UPDATE/custom_bl/
|
88 |
cp -f /etc/dansguardian/lists/exceptionsitelist $DIR_UPDATE/custom_bl/
|
89 |
cp -f /etc/dansguardian/lists/bannedsitelist $DIR_UPDATE/custom_bl/
|
89 |
cp -f /etc/dansguardian/lists/bannedsitelist $DIR_UPDATE/custom_bl/
|
90 |
cp -f /etc/dansguardian/lists/exceptionurllist $DIR_UPDATE/custom_bl/
|
90 |
cp -f /etc/dansguardian/lists/exceptionurllist $DIR_UPDATE/custom_bl/
|
91 |
cp -f /etc/dansguardian/lists/bannedurllist $DIR_UPDATE/custom_bl/
|
91 |
cp -f /etc/dansguardian/lists/bannedurllist $DIR_UPDATE/custom_bl/
|
92 |
cp -f $DIR_SHARE/dnsmasq-bl/ossi.conf $DIR_UPDATE/custom_bl/ossi-dnsbl.conf
|
- |
|
93 |
cp -f $DIR_SHARE/dnsmasq-wl/ossi.conf $DIR_UPDATE/custom_bl/ossi-dnswl.conf
|
- |
|
94 |
cp -f $DIR_SHARE/iptables-bl/ossi $DIR_UPDATE/custom_bl/ossi-ipbl
|
- |
|
95 |
cp -f $DIR_SHARE/iptables-wl/ossi $DIR_UPDATE/custom_bl/ossi-ipwl
|
92 |
cp -rf $DIR_BLACKLIST/ossi-* $DIR_UPDATE/custom_bl/
|
96 |
# backup of different conf files (main conf file, filtering, digest, etc)
|
93 |
# backup of different conf files (main conf file, filtering, digest, etc)
|
97 |
mkdir $DIR_UPDATE/etc/
|
94 |
mkdir $DIR_UPDATE/etc/
|
98 |
cp -rf $DIR_ETC/* $DIR_UPDATE/etc/
|
95 |
cp -rf $DIR_ETC/* $DIR_UPDATE/etc/
|
99 |
# backup of the security certificates (server & CA)
|
96 |
# backup of the security certificates (server & CA)
|
100 |
cp -f /etc/pki/tls/certs/alcasar.crt* $DIR_UPDATE # autosigned and official if exist
|
97 |
cp -f /etc/pki/tls/certs/alcasar.crt* $DIR_UPDATE # autosigned and official if exist
|
Line 137... |
Line 134... |
137 |
cp -f $DIR_UPDATE/custom_bl/exceptionsitelist /etc/dansguardian/lists/
|
134 |
cp -f $DIR_UPDATE/custom_bl/exceptionsitelist /etc/dansguardian/lists/
|
138 |
cp -f $DIR_UPDATE/custom_bl/urlregexplist /etc/dansguardian/lists/
|
135 |
cp -f $DIR_UPDATE/custom_bl/urlregexplist /etc/dansguardian/lists/
|
139 |
cp -f $DIR_UPDATE/custom_bl/bannedsitelist /etc/dansguardian/lists/
|
136 |
cp -f $DIR_UPDATE/custom_bl/bannedsitelist /etc/dansguardian/lists/
|
140 |
cp -f $DIR_UPDATE/custom_bl/exceptionurllist /etc/dansguardian/lists/
|
137 |
cp -f $DIR_UPDATE/custom_bl/exceptionurllist /etc/dansguardian/lists/
|
141 |
cp -f $DIR_UPDATE/custom_bl/bannedurllist /etc/dansguardian/lists/
|
138 |
cp -f $DIR_UPDATE/custom_bl/bannedurllist /etc/dansguardian/lists/
|
142 |
cp -f $DIR_UPDATE/custom_bl/ossi-dnsbl.conf $DIR_SHARE/dnsmasq-bl/ossi.conf
|
- |
|
143 |
cp -f $DIR_UPDATE/custom_bl/ossi-dnswl.conf $DIR_SHARE/dnsmasq-wl/ossi.conf
|
- |
|
144 |
cp -f $DIR_UPDATE/custom_bl/ossi-ipbl $DIR_SHARE/iptables-bl/ossi
|
- |
|
145 |
cp -f $DIR_UPDATE/custom_bl/ossi-ipwl $DIR_SHARE/iptables-wl/ossi
|
139 |
cp -rf $DIR_UPDATE/custom_bl/ossi-* $DIR_BLACKLIST/
|
146 |
chown -R dansguardian:apache /etc/dansguardian/lists
|
140 |
chown -R dansguardian:apache /etc/dansguardian/lists
|
147 |
chmod -R g+rw /etc/dansguardian/lists
|
141 |
chmod -R g+rw /etc/dansguardian/lists
|
148 |
# Adapt DNS/URL filtering
|
142 |
# Adapt DNS/URL filtering
|
149 |
PARENT_SCRIPT=`basename $0`
|
143 |
PARENT_SCRIPT=`basename $0`
|
150 |
export PARENT_SCRIPT
|
144 |
export PARENT_SCRIPT
|
151 |
$DIR_BIN/alcasar-bl.sh -adapt
|
145 |
$DIR_BIN/alcasar-bl.sh -cat_choice
|
152 |
$DIR_BIN/alcasar-bl.sh -reload
|
146 |
$DIR_BIN/alcasar-bl.sh -reload
|
153 |
# retrieve dnsmasq general config file
|
147 |
# retrieve dnsmasq general config file
|
154 |
[ -e $DIR_UPDATE/dnsmasq ] && cp -f $DIR_UPDATE/dnsmasq /etc/sysconfig/dnsmasq \
|
148 |
[ -e $DIR_UPDATE/dnsmasq ] && cp -f $DIR_UPDATE/dnsmasq /etc/sysconfig/dnsmasq \
|
155 |
&& chown root.root /etc/sysconfig/dnsmasq \
|
149 |
&& chown root.root /etc/sysconfig/dnsmasq \
|
156 |
&& chmod 644 /etc/sysconfig/dnsmasq
|
150 |
&& chmod 644 /etc/sysconfig/dnsmasq
|