Line 1... |
Line 1... |
1 |
#!/bin/bash
|
1 |
#!/bin/bash
|
2 |
# $Id: alcasar-conf.sh 2875 2020-11-01 10:50:57Z rexy $
|
2 |
# $Id: alcasar-conf.sh 2878 2020-11-01 21:48:35Z 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 18... |
Line 18... |
18 |
DIR_WEB="/var/www/html" # répertoire du centre de gestion
|
18 |
DIR_WEB="/var/www/html" # répertoire du centre de gestion
|
19 |
DIR_BIN="/usr/local/bin" # scripts directory
|
19 |
DIR_BIN="/usr/local/bin" # scripts directory
|
20 |
DIR_ETC="/usr/local/etc" # conf directory
|
20 |
DIR_ETC="/usr/local/etc" # conf directory
|
21 |
DIR_E2G="/etc/e2guardian/lists" # Toulouse BL directory
|
21 |
DIR_E2G="/etc/e2guardian/lists" # Toulouse BL directory
|
22 |
DIR_BLACKLIST="$DIR_E2G/blacklists" # Toulouse BL directory
|
22 |
DIR_BLACKLIST="$DIR_E2G/blacklists" # Toulouse BL directory
|
23 |
CONF_FILE="$DIR_ETC/alcasar.conf" # main alcasar conf file
|
23 |
CONF_FILE="$DIR_ETC/alcasar.conf" # main alcasar conf file
|
- |
|
24 |
PASSWD_FILE="/root/ALCASAR-passwords.txt"
|
- |
|
25 |
DB_USER=$(grep '^db_user=' $PASSWD_FILE | cut -d'=' -f 2-)
|
- |
|
26 |
DB_PASS=$(grep '^db_password=' $PASSWD_FILE | cut -d'=' -f 2-)
|
24 |
EXTIF=`grep ^EXTIF= $CONF_FILE|cut -d"=" -f2` # EXTernal InterFace
|
27 |
EXTIF=`grep ^EXTIF= $CONF_FILE|cut -d"=" -f2` # EXTernal InterFace
|
25 |
INTIF=`grep ^INTIF= $CONF_FILE|cut -d"=" -f2` # INTernal InterFace
|
28 |
INTIF=`grep ^INTIF= $CONF_FILE|cut -d"=" -f2` # INTernal InterFace
|
26 |
MTU=`grep ^PUBLIC_MTU= $CONF_FILE|cut -d"=" -f2`
|
29 |
MTU=`grep ^PUBLIC_MTU= $CONF_FILE|cut -d"=" -f2`
|
27 |
DHCP_mode=`grep ^DHCP= $CONF_FILE|cut -d"=" -f2`
|
30 |
DHCP_mode=`grep ^DHCP= $CONF_FILE|cut -d"=" -f2`
|
28 |
INT_DNS_mode=`grep ^INT_DNS_ACTIVE= $CONF_FILE|cut -d"=" -f2`
|
31 |
INT_DNS_mode=`grep ^INT_DNS_ACTIVE= $CONF_FILE|cut -d"=" -f2`
|
Line 472... |
Line 475... |
472 |
$SED "s?^PRIVATE_IP=.*?PRIVATE_IP=\"$PRIVATE_IP\"?g" $DIR_BIN/alcasar-watchdog.sh
|
475 |
$SED "s?^PRIVATE_IP=.*?PRIVATE_IP=\"$PRIVATE_IP\"?g" $DIR_BIN/alcasar-watchdog.sh
|
473 |
# Prompts
|
476 |
# Prompts
|
474 |
$SED "s?^ORGANISME.*?ORGANISME=$ORGANISME?g" /etc/bashrc
|
477 |
$SED "s?^ORGANISME.*?ORGANISME=$ORGANISME?g" /etc/bashrc
|
475 |
# sudoers
|
478 |
# sudoers
|
476 |
$SED "s?^Host_Alias.*?Host_Alias LAN_ORG=$PRIVATE_NETWORK/$PRIVATE_NETMASK,localhost #réseau de l'organisme?g" /etc/sudoers
|
479 |
$SED "s?^Host_Alias.*?Host_Alias LAN_ORG=$PRIVATE_NETWORK/$PRIVATE_NETMASK,localhost #réseau de l'organisme?g" /etc/sudoers
|
- |
|
480 |
# gammu-smsd
|
- |
|
481 |
$SED "s?^user =.*?user = $DB_USER?g" /etc/gammu_smsd_conf
|
- |
|
482 |
$SED "s?^password =.*?password = $DB_PASS?g" /etc/gammu_smsd_conf
|
- |
|
483 |
# Services start
|
477 |
if [ "$PARENT_SCRIPT" != "alcasar.sh" ] # don't launch on install stage
|
484 |
if [ "$PARENT_SCRIPT" != "alcasar.sh" ] # don't launch on install stage
|
478 |
then
|
485 |
then
|
479 |
# Services start
|
- |
|
480 |
/usr/bin/systemctl start network && echo -n "Start service : network" && sleep 1
|
486 |
/usr/bin/systemctl start network && echo -n "Start service : network" && sleep 1
|
481 |
$DIR_BIN/alcasar-dhcp.sh -$DHCP_mode && echo -n ", chilli" # apply DHCP mode and start CoovaChilli
|
487 |
$DIR_BIN/alcasar-dhcp.sh -$DHCP_mode && echo -n ", chilli" # apply DHCP mode and start CoovaChilli
|
482 |
for i in unbound unbound-blackhole ntpd
|
488 |
for i in unbound unbound-blackhole ntpd
|
483 |
do
|
489 |
do
|
484 |
sleep 1
|
490 |
sleep 1
|