Line 1... |
Line 1... |
1 |
#/bin/bash
|
1 |
#/bin/bash
|
2 |
# $Id: alcasar-conf.sh 1890 2016-05-17 16:08:51Z franck $
|
2 |
# $Id: alcasar-conf.sh 1912 2016-05-29 13:18:17Z 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 |
CONF_FILE="$DIR_ETC/alcasar.conf" # main alcasar conf file
|
24 |
CONF_FILE="$DIR_ETC/alcasar.conf" # main alcasar conf file
|
24 |
VERSION="/var/www/html/VERSION" # contient la version en cours
|
25 |
VERSION="/var/www/html/VERSION" # contient la version en cours
|
25 |
EXTIF=`grep ^EXTIF= $CONF_FILE|cut -d"=" -f2` # EXTernal InterFace
|
26 |
EXTIF=`grep ^EXTIF= $CONF_FILE|cut -d"=" -f2` # EXTernal InterFace
|
26 |
INTIF=`grep ^INTIF= $CONF_FILE|cut -d"=" -f2` # INTernal InterFace
|
27 |
INTIF=`grep ^INTIF= $CONF_FILE|cut -d"=" -f2` # INTernal InterFace
|
27 |
MTU=`grep ^PUBLIC_MTU= $CONF_FILE|cut -d"=" -f2` # INTernal InterFace
|
28 |
MTU=`grep ^PUBLIC_MTU= $CONF_FILE|cut -d"=" -f2` # INTernal InterFace
|
Line 74... |
Line 75... |
74 |
# backup the users database
|
75 |
# backup the users database
|
75 |
$DIR_BIN/alcasar-mysql.sh -dump
|
76 |
$DIR_BIN/alcasar-mysql.sh -dump
|
76 |
cp /var/Save/base/`ls -1t /var/Save/base|head -1` $DIR_UPDATE
|
77 |
cp /var/Save/base/`ls -1t /var/Save/base|head -1` $DIR_UPDATE
|
77 |
# backup the logo
|
78 |
# backup the logo
|
78 |
cp -f $DIR_WEB/images/organisme.png $DIR_UPDATE
|
79 |
cp -f $DIR_WEB/images/organisme.png $DIR_UPDATE
|
79 |
# backup Dansguardian files
|
80 |
# backup BL/WL custom files
|
80 |
cp -f /etc/dansguardian/lists/exceptioniplist $DIR_UPDATE
|
81 |
cp -f /etc/dansguardian/lists/exceptioniplist $DIR_UPDATE/dansguardian/
|
81 |
cp -f /etc/dansguardian/lists/urlregexplist $DIR_UPDATE
|
82 |
cp -f /etc/dansguardian/lists/urlregexplist $DIR_UPDATE/dansguardian/
|
82 |
cp -f /etc/dansguardian/lists/exceptionsitelist $DIR_UPDATE
|
83 |
cp -f /etc/dansguardian/lists/exceptionsitelist $DIR_UPDATE/dansguardian/
|
83 |
cp -f /etc/dansguardian/lists/bannedsitelist $DIR_UPDATE
|
84 |
cp -f /etc/dansguardian/lists/bannedsitelist $DIR_UPDATE/dansguardian/
|
84 |
cp -f /etc/dansguardian/lists/exceptionurllist $DIR_UPDATE
|
85 |
cp -f /etc/dansguardian/lists/exceptionurllist $DIR_UPDATE/dansguardian/
|
85 |
cp -f /etc/dansguardian/lists/bannedurllist $DIR_UPDATE
|
86 |
cp -f /etc/dansguardian/lists/bannedurllist $DIR_UPDATE/dansguardian/
|
- |
|
87 |
cp -f $DIR_SHARE/dnsmasq-bl/ossi.conf $DIR_UPDATE/dnsmasq-bl/ossi.conf
|
- |
|
88 |
cp -f $DIR_SHARE/dnsmasq-wl/ossi.conf $DIR_UPDATE/dnsmasq-wl/ossi.conf
|
- |
|
89 |
cp -f $DIR_SHARE/iptables-bl/ossi $DIR_UPDATE/iptables-bl/ossi
|
86 |
cp -rf /etc/dansguardian/lists/blacklists/ossi $DIR_UPDATE
|
90 |
cp -f $DIR_SHARE/iptables-wl/ossi $DIR_UPDATE/iptables-wl/ossi
|
87 |
# backup of different conf files (main conf file, filtering, digest, etc)
|
91 |
# backup of different conf files (main conf file, filtering, digest, etc)
|
88 |
mkdir $DIR_UPDATE/etc/
|
92 |
mkdir $DIR_UPDATE/etc/
|
89 |
cp -rf $DIR_ETC/* $DIR_UPDATE/etc/
|
93 |
cp -rf $DIR_ETC/* $DIR_UPDATE/etc/
|
90 |
# backup of the security certificates (server & CA)
|
94 |
# backup of the security certificates (server & CA)
|
91 |
cp -f /etc/pki/tls/certs/alcasar.crt* $DIR_UPDATE # autosigned and official if exist
|
95 |
cp -f /etc/pki/tls/certs/alcasar.crt* $DIR_UPDATE # autosigned and official if exist
|