Line 1... |
Line 1... |
1 |
#!/bin/bash
|
1 |
#!/bin/bash
|
2 |
# $Id: alcasar-conf.sh 2409 2017-09-14 18:52:54Z tom.houdayer $
|
2 |
# $Id: alcasar-conf.sh 2412 2017-09-17 12:11:23Z tom.houdayer $
|
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 29... |
Line 29... |
29 |
DHCP_mode=`grep ^DHCP= $CONF_FILE|cut -d"=" -f2`
|
29 |
DHCP_mode=`grep ^DHCP= $CONF_FILE|cut -d"=" -f2`
|
30 |
INT_DNS_mode=`grep ^INT_DNS_ACTIVE= $CONF_FILE|cut -d"=" -f2`
|
30 |
INT_DNS_mode=`grep ^INT_DNS_ACTIVE= $CONF_FILE|cut -d"=" -f2`
|
31 |
LDAP_mode=`grep ^LDAP= $CONF_FILE|cut -d"=" -f2`
|
31 |
LDAP_mode=`grep ^LDAP= $CONF_FILE|cut -d"=" -f2`
|
32 |
HOSTNAME=`grep ^HOSTNAME= $CONF_FILE|cut -d"=" -f2`
|
32 |
HOSTNAME=`grep ^HOSTNAME= $CONF_FILE|cut -d"=" -f2`
|
33 |
DOMAIN=`grep ^DOMAIN= $CONF_FILE|cut -d"=" -f2`
|
33 |
DOMAIN=`grep ^DOMAIN= $CONF_FILE|cut -d"=" -f2`
|
34 |
DB_USER="radius"
|
34 |
PASSWD_FILE="/root/ALCASAR-passwords.txt"
|
35 |
radiuspwd=""
|
35 |
DB_USER=$(grep '^db_user=' $PASSWD_FILE | cut -d'=' -f 2-)
|
- |
|
36 |
DB_PASS=$(grep '^db_password=' $PASSWD_FILE | cut -d'=' -f 2-)
|
36 |
SED="/bin/sed -i"
|
37 |
SED="/bin/sed -i"
|
37 |
RUNNING_VERSION=`grep ^VERSION= $CONF_FILE|cut -d'=' -f2`
|
38 |
RUNNING_VERSION=`grep ^VERSION= $CONF_FILE|cut -d'=' -f2`
|
38 |
MAJ_RUNNING_VERSION=`echo $RUNNING_VERSION|cut -d"." -f1`
|
39 |
MAJ_RUNNING_VERSION=`echo $RUNNING_VERSION|cut -d"." -f1`
|
39 |
MIN_RUNNING_VERSION=`echo $RUNNING_VERSION|cut -d"." -f2|cut -c1`
|
40 |
MIN_RUNNING_VERSION=`echo $RUNNING_VERSION|cut -d"." -f2|cut -c1`
|
40 |
UPD_RUNNING_VERSION=`echo $RUNNING_VERSION|cut -d"." -f3`
|
41 |
UPD_RUNNING_VERSION=`echo $RUNNING_VERSION|cut -d"." -f3`
|
Line 128... |
Line 129... |
128 |
cp -f $DIR_UPDATE/alcasar.key /etc/pki/tls/private/
|
129 |
cp -f $DIR_UPDATE/alcasar.key /etc/pki/tls/private/
|
129 |
[ -e $DIR_UPDATE/server-chain.crt ] && cp -f $DIR_UPDATE/server-chain.crt* /etc/pki/tls/certs/ # autosigned and official if exist
|
130 |
[ -e $DIR_UPDATE/server-chain.crt ] && cp -f $DIR_UPDATE/server-chain.crt* /etc/pki/tls/certs/ # autosigned and official if exist
|
130 |
chown -R root:apache /etc/pki
|
131 |
chown -R root:apache /etc/pki
|
131 |
chmod -R 750 /etc/pki
|
132 |
chmod -R 750 /etc/pki
|
132 |
# Import of the users database
|
133 |
# Import of the users database
|
133 |
gzip -dc < `ls $DIR_UPDATE/alcasar-users-database*` | mysql -u$DB_USER -p$radiuspwd
|
134 |
gzip -dc < `ls $DIR_UPDATE/alcasar-users-database*` | mysql -u$DB_USER -p$DB_PASS
|
134 |
# Retrieve local parameters
|
135 |
# Retrieve local parameters
|
135 |
[ -d $DIR_UPDATE/etc ] && cp -rf $DIR_UPDATE/etc/* $DIR_ETC/
|
136 |
[ -d $DIR_UPDATE/etc ] && cp -rf $DIR_UPDATE/etc/* $DIR_ETC/
|
136 |
# Retrieve BL/WL custom files
|
137 |
# Retrieve BL/WL custom files
|
137 |
cp -f $DIR_UPDATE/custom_bl/exceptioniplist /etc/dansguardian/lists/
|
138 |
cp -f $DIR_UPDATE/custom_bl/exceptioniplist /etc/dansguardian/lists/
|
138 |
cp -f $DIR_UPDATE/custom_bl/exceptionsitelist /etc/dansguardian/lists/
|
139 |
cp -f $DIR_UPDATE/custom_bl/exceptionsitelist /etc/dansguardian/lists/
|