116,13 → 116,13 |
} # End of header_install() |
|
######################################################## |
## Function "testing" ## |
## Function "testing_system" ## |
## - Test Mageia version ## |
## - Test ALCASAR version (if already installed) ## |
## - Test free space on /var (>10G) ## |
## - Test Internet access ## |
######################################################## |
testing() |
testing_system() |
{ |
# Test of Mageia version |
# extract the current Mageia version and hardware architecture (i586 ou X64) |
211,12 → 211,7 |
then |
rm -f /var/tmp/alcasar-conf* |
else |
# Retrieve former NICname |
EXTIF_saved=`grep ^EXTIF= $CONF_FILE | cut -d'=' -f2-` # EXTernal InterFace |
INTIF_saved=`grep ^INTIF= $CONF_FILE | cut -d'=' -f2-` # INTernal InterFace |
[ "$(/usr/sbin/ip link | grep -c " $EXTIF_saved:")" -ne 0 ] && EXTIF=$EXTIF_saved || echo "Warning: Network card \"$EXTIF_saved\" is not connected, so \"$EXTIF\" will be used for external network." |
[ "$(/usr/sbin/ip link | grep -c " $INTIF_saved:")" -ne 0 ] && INTIF=$INTIF_saved || echo "Warning: Network card \"$INTIF_saved\" is not connected, so \"$INTIF\" will be used for internal network." |
# Create the current conf file |
# Create the archive of conf files |
$DIR_SCRIPTS/alcasar-conf.sh --create |
mode="update" |
fi |
234,7 → 229,14 |
fi |
exit 0 |
fi |
} # End of testing_system |
|
######################################################## |
## Function "testing_network" ## |
## - Test Internet access ## |
######################################################## |
testing_network() |
{ |
# Detect external/internal interfaces |
if [ -z "$EXTIF" ]; then |
EXTIF=$(/usr/sbin/ip route list | awk '/^default / {print $5}') |
413,7 → 415,7 |
exit 1 |
fi |
echo ". : ok" |
} # End of testing() |
} # End of testing_network() |
|
####################################################################### |
## Function "init" ## |
643,7 → 645,8 |
IPADDR=$PUBLIC_IP |
NETMASK=$PUBLIC_NETMASK |
GATEWAY=$PUBLIC_GATEWAY |
DNS1=127.0.0.1 |
DNS1=$DNS1 |
DNS2=$DNS2 |
RESOLV_MODS=yes |
ONBOOT=yes |
METRIC=10 |
1472,7 → 1475,7 |
# vnstat-dashboard |
$SED "s?^\$thisInterface.*?\$thisInterface = \"$EXTIF\";?" $DIR_ACC/manager/vnstat/index.php |
[ -e /lib/systemd/system/vnstat.service.default ] || cp /lib/systemd/system/vnstat.service /lib/systemd/system/vnstat.service.default |
$SED "s?^PIDFILE=.*?PIDFILE=/var/run/vnstat/vnstat.pid?g" /lib/systemd/system/vnstat.service |
$SED "s?^PIDFILE=.*?PIDFILE=/run/vnstat/vnstat.pid?g" /lib/systemd/system/vnstat.service |
} # End of vnstat() |
|
################################################################### |
2209,7 → 2212,6 |
ExecStart=$DIR_DEST_BIN/alcasar-load_balancing.sh start |
ExecStop=$DIR_DEST_BIN/alcasar-load_balancing.sh stop |
TimeoutSec=0 |
SysVStartPriority=99 |
|
[Install] |
WantedBy=multi-user.target |
2373,13 → 2375,13 |
exit 0 |
;; |
-i | --install) |
for func in license testing |
for func in license testing_system |
do |
header_install |
$func |
if [ $DEBUG_ALCASAR == "on" ] |
then |
echo "*** 'debug' : end of install '$func' ***" |
echo "*** 'debug' : end of function '$func' ***" |
read |
fi |
done |
2449,12 → 2451,12 |
fi |
mode="update" |
fi |
for func in init network CA ACC time_server init_db freeradius chilli e2guardian antivirus ulogd nfsen vnstat dnsmasq unbound dhcpd BL cron fail2ban gammu_smsd msec letsencrypt post_install |
for func in testing_network init network CA ACC time_server init_db freeradius chilli e2guardian antivirus ulogd nfsen vnstat dnsmasq unbound dhcpd BL cron fail2ban gammu_smsd msec letsencrypt post_install |
do |
$func |
if [ $DEBUG_ALCASAR == "on" ] |
then |
echo "*** 'debug' : end of install '$func' ***" |
echo "*** 'debug' : end of function '$func' ***" |
read |
fi |
done |