Line 1... |
Line 1... |
1 |
#!/bin/bash
|
1 |
#!/bin/bash
|
2 |
# $Id: alcasar-conf.sh 3190 2024-04-07 22:35:03Z rexy $
|
2 |
# $Id: alcasar-conf.sh 3195 2024-04-23 22:39:48Z rexy $
|
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 73... |
Line 73... |
73 |
# backup the users database (test to delete in future version)
|
73 |
# backup the users database (test to delete in future version)
|
74 |
$DIR_BIN/alcasar-mysql.sh --dump
|
74 |
$DIR_BIN/alcasar-mysql.sh --dump
|
75 |
cp /var/Save/base/"$(ls -1t /var/Save/base|head -1)" $DIR_UPDATE
|
75 |
cp /var/Save/base/"$(ls -1t /var/Save/base|head -1)" $DIR_UPDATE
|
76 |
# backup organism logo
|
76 |
# backup organism logo
|
77 |
cp -f $DIR_WEB/images/organisme.png $DIR_UPDATE
|
77 |
cp -f $DIR_WEB/images/organisme.png $DIR_UPDATE
|
78 |
# backup BL/WL custom files
|
78 |
# backup E2D BL/WL custom files
|
79 |
mkdir $DIR_UPDATE/custom_bl
|
79 |
mkdir $DIR_UPDATE/custom_bl
|
80 |
for i in exceptioniplist urlregexplist exceptionsitelist bannedsitelist exceptionurllist bannedurllist
|
80 |
for i in urlregexplist exceptionsitelist bannedurllist
|
81 |
do
|
81 |
do
|
82 |
if [ -d /etc/dansguardian ]; then
|
- |
|
83 |
cp /etc/dansguardian/lists/$i $DIR_UPDATE/custom_bl/ # before V3.3
|
- |
|
84 |
cp -rf /etc/dansguardian/lists/blacklists/ossi-* $DIR_UPDATE/custom_bl/ 2>/dev/null
|
- |
|
85 |
else
|
- |
|
86 |
cp $DIR_E2G/$i $DIR_UPDATE/custom_bl/ # since V3.3
|
82 |
cp $DIR_E2G/group1/$i $DIR_UPDATE/custom_bl/
|
87 |
cp -rf $DIR_BLACKLIST/ossi-* $DIR_UPDATE/custom_bl/ 2>/dev/null
|
- |
|
88 |
fi
|
- |
|
89 |
done
|
83 |
done
|
- |
|
84 |
cp $DIR_E2G/common/exceptioniplist $DIR_UPDATE/custom_bl/
|
- |
|
85 |
cp -rf $DIR_BLACKLIST/ossi-* $DIR_UPDATE/custom_bl/ 2>/dev/null
|
90 |
# backup conf files (main conf file, filtering, digest, etc.)
|
86 |
# backup conf files (main conf file, filtering, digest, etc.)
|
91 |
mkdir $DIR_UPDATE/etc/
|
87 |
mkdir $DIR_UPDATE/etc/
|
92 |
cp -rf $DIR_ETC/* $DIR_UPDATE/etc/
|
88 |
cp -rf $DIR_ETC/* $DIR_UPDATE/etc/
|
93 |
cp -f /etc/hosts $DIR_UPDATE/etc/
|
89 |
cp -f /etc/hosts $DIR_UPDATE/etc/
|
94 |
# backup of the security certificates (server & CA)
|
90 |
# backup of the security certificates (server & CA)
|
Line 179... |
Line 175... |
179 |
[ -e $DIR_UPDATE/etc/alcasar-letsencrypt ] && cp -f $DIR_UPDATE/etc/alcasar-letsencrypt $DIR_ETC/ # Letsencrypt local conf
|
175 |
[ -e $DIR_UPDATE/etc/alcasar-letsencrypt ] && cp -f $DIR_UPDATE/etc/alcasar-letsencrypt $DIR_ETC/ # Letsencrypt local conf
|
180 |
[ -d $DIR_UPDATE/etc/letsencrypt ] && cp -rf $DIR_UPDATE/etc/letsencrypt $DIR_ETC/ # Letsencrypt local conf files
|
176 |
[ -d $DIR_UPDATE/etc/letsencrypt ] && cp -rf $DIR_UPDATE/etc/letsencrypt $DIR_ETC/ # Letsencrypt local conf files
|
181 |
[ -e $DIR_UPDATE/gammurc ] && cp -f $DIR_UPDATE/gammurc /etc/ # Gammu conf file
|
177 |
[ -e $DIR_UPDATE/gammurc ] && cp -f $DIR_UPDATE/gammurc /etc/ # Gammu conf file
|
182 |
[ -e $DIR_UPDATE/gammu_smsd_conf ] && cp -f $DIR_UPDATE/gammu_smsd_conf /etc/ # Gammu_smsd conf file
|
178 |
[ -e $DIR_UPDATE/gammu_smsd_conf ] && cp -f $DIR_UPDATE/gammu_smsd_conf /etc/ # Gammu_smsd conf file
|
183 |
# Retrieve BL/WL custom files
|
179 |
# Retrieve BL/WL custom files
|
184 |
cp -f $DIR_UPDATE/custom_bl/exceptioniplist $DIR_E2G/
|
180 |
cp -f $DIR_UPDATE/custom_bl/exceptioniplist $DIR_E2G/common/
|
185 |
cp -f $DIR_UPDATE/custom_bl/exceptionsitelist $DIR_E2G/
|
181 |
cp -f $DIR_UPDATE/custom_bl/exceptionsitelist $DIR_E2G/group1/
|
186 |
cp -f $DIR_UPDATE/custom_bl/urlregexplist $DIR_E2G/
|
182 |
cp -f $DIR_UPDATE/custom_bl/urlregexplist $DIR_E2G/
|
187 |
cp -f $DIR_UPDATE/custom_bl/bannedsitelist $DIR_E2G/
|
- |
|
188 |
cp -f $DIR_UPDATE/custom_bl/exceptionurllist $DIR_E2G/
|
- |
|
189 |
cp -f $DIR_UPDATE/custom_bl/bannedurllist $DIR_E2G/
|
183 |
cp -f $DIR_UPDATE/custom_bl/bannedurllist $DIR_E2G/group1/
|
190 |
cp -rf $DIR_UPDATE/custom_bl/ossi-* $DIR_BLACKLIST/ 2>/dev/null
|
184 |
cp -rf $DIR_UPDATE/custom_bl/ossi-* $DIR_BLACKLIST/ 2>/dev/null
|
191 |
chown -R e2guardian:apache $DIR_E2G
|
185 |
chown -R e2guardian:apache $DIR_E2G
|
192 |
chmod -R g+rw $DIR_E2G
|
186 |
chmod -R g+rw $DIR_E2G
|
193 |
# Adapt DNS/URL filtering
|
187 |
# Adapt DNS/URL filtering
|
194 |
PARENT_SCRIPT=`basename $0`
|
188 |
PARENT_SCRIPT=`basename $0`
|