Line 1... |
Line 1... |
1 |
#!/bin/bash
|
1 |
#!/bin/bash
|
2 |
# $Id: alcasar.sh 1833 2016-04-24 15:32:42Z richard $
|
2 |
# $Id: alcasar.sh 1834 2016-04-24 19:01:36Z richard $
|
3 |
|
3 |
|
4 |
# alcasar.sh
|
4 |
# alcasar.sh
|
5 |
|
5 |
|
6 |
# ALCASAR Install script - CopyLeft ALCASAR Team [Rexy + 3abtux + Steweb + Crox + ...]
|
6 |
# ALCASAR Install script - CopyLeft ALCASAR Team [Rexy + 3abtux + Steweb + Crox + ...]
|
7 |
# Ce programme est un logiciel libre ; This software is free and open source
|
7 |
# Ce programme est un logiciel libre ; This software is free and open source
|
Line 27... |
Line 27... |
27 |
|
27 |
|
28 |
# Functions :
|
28 |
# Functions :
|
29 |
# testing : connectivity tests, free space test and mageia version test
|
29 |
# testing : connectivity tests, free space test and mageia version test
|
30 |
# init : Installation of RPM and scripts
|
30 |
# init : Installation of RPM and scripts
|
31 |
# network : Network parameters
|
31 |
# network : Network parameters
|
32 |
# time : NTPd configuration
|
32 |
# time_server : NTPd configuration
|
33 |
# ACC : ALCASAR Control Center installation
|
33 |
# ACC : ALCASAR Control Center installation
|
34 |
# CA : Certification Authority initialization
|
34 |
# CA : Certification Authority initialization
|
35 |
# init_db : Initilization of radius database managed with MariaDB
|
35 |
# init_db : Initilization of radius database managed with MariaDB
|
36 |
# radius : FreeRadius initialisation
|
36 |
# radius : FreeRadius initialisation
|
37 |
# chilli : coovachilli initialisation (+authentication page)
|
37 |
# chilli : coovachilli initialisation (+authentication page)
|
Line 612... |
Line 612... |
612 |
#
|
612 |
#
|
613 |
# the script "$DIR_DEST_BIN/alcasar-iptables.sh" is launched at the end in order to allow update via ssh
|
613 |
# the script "$DIR_DEST_BIN/alcasar-iptables.sh" is launched at the end in order to allow update via ssh
|
614 |
} # End of network ()
|
614 |
} # End of network ()
|
615 |
|
615 |
|
616 |
##################################################################
|
616 |
##################################################################
|
617 |
## Function "time" ##
|
617 |
## Function "time_server" ##
|
618 |
## - Configuring NTP server ##
|
618 |
## - Configuring NTP server ##
|
619 |
##################################################################
|
619 |
##################################################################
|
620 |
time ()
|
620 |
time_server ()
|
621 |
{
|
621 |
{
|
622 |
# Set the Internet time server
|
622 |
# Set the Internet time server
|
623 |
[ -e /etc/ntp/step-tickers.default ] || cp /etc/ntp/step-tickers /etc/ntp/step-tickers.default
|
623 |
[ -e /etc/ntp/step-tickers.default ] || cp /etc/ntp/step-tickers /etc/ntp/step-tickers.default
|
624 |
cat <<EOF > /etc/ntp/step-tickers
|
624 |
cat <<EOF > /etc/ntp/step-tickers
|
625 |
0.fr.pool.ntp.org # adapt to your country
|
625 |
0.fr.pool.ntp.org # adapt to your country
|
Line 640... |
Line 640... |
640 |
disable monitor
|
640 |
disable monitor
|
641 |
EOF
|
641 |
EOF
|
642 |
chown -R ntp:ntp /var/lib/ntp
|
642 |
chown -R ntp:ntp /var/lib/ntp
|
643 |
# Synchronize now
|
643 |
# Synchronize now
|
644 |
ntpd -q -g &
|
644 |
ntpd -q -g &
|
645 |
} # End of time ()
|
645 |
} # End of time_server ()
|
646 |
##################################################################
|
646 |
##################################################################
|
647 |
## Function "ACC" ##
|
647 |
## Function "ACC" ##
|
648 |
## - installation du centre de gestion (ALCASAR Control Center) ##
|
648 |
## - installation du centre de gestion (ALCASAR Control Center) ##
|
649 |
## - configuration du serveur web (Apache) ##
|
649 |
## - configuration du serveur web (Apache) ##
|
650 |
## - définition du 1er comptes de gestion ##
|
650 |
## - définition du 1er comptes de gestion ##
|
Line 2069... |
Line 2069... |
2069 |
MAJ_PREVIOUS_VERSION=`echo $PREVIOUS_VERSION|cut -d"." -f1`
|
2069 |
MAJ_PREVIOUS_VERSION=`echo $PREVIOUS_VERSION|cut -d"." -f1`
|
2070 |
MIN_PREVIOUS_VERSION=`echo $PREVIOUS_VERSION|cut -d"." -f2|cut -c1`
|
2070 |
MIN_PREVIOUS_VERSION=`echo $PREVIOUS_VERSION|cut -d"." -f2|cut -c1`
|
2071 |
UPD_PREVIOUS_VERSION=`echo $PREVIOUS_VERSION|cut -d"." -f3`
|
2071 |
UPD_PREVIOUS_VERSION=`echo $PREVIOUS_VERSION|cut -d"." -f3`
|
2072 |
mode="update"
|
2072 |
mode="update"
|
2073 |
fi
|
2073 |
fi
|
2074 |
for func in init network time ACC CA init_db radius chilli dansguardian antivirus tinyproxy ulogd nfsen vnstat dnsmasq BL cron fail2ban gammu_smsd post_install
|
2074 |
for func in init network time_server ACC CA init_db radius chilli dansguardian antivirus tinyproxy ulogd nfsen vnstat dnsmasq BL cron fail2ban gammu_smsd post_install
|
2075 |
do
|
2075 |
do
|
2076 |
$func
|
2076 |
$func
|
2077 |
# echo "*** 'debug' : end of function $func ***"; read a
|
2077 |
# echo "*** 'debug' : end of function $func ***"; read a
|
2078 |
done
|
2078 |
done
|
2079 |
;;
|
2079 |
;;
|