Subversion Repositories ALCASAR

Compare Revisions

Regard whitespace Rev 2870 → Rev 2869

/alcasar.sh
116,13 → 116,13
} # End of header_install()
 
########################################################
## Function "testing_system" ##
## Function "testing" ##
## - Test Mageia version ##
## - Test ALCASAR version (if already installed) ##
## - Test free space on /var (>10G) ##
## - Test Internet access ##
########################################################
testing_system()
testing()
{
# Test of Mageia version
# extract the current Mageia version and hardware architecture (i586 ou X64)
211,7 → 211,12
then
rm -f /var/tmp/alcasar-conf*
else
# Create the archive of conf files
# 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
$DIR_SCRIPTS/alcasar-conf.sh --create
mode="update"
fi
229,14 → 234,7
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}')
415,7 → 413,7
exit 1
fi
echo ". : ok"
} # End of testing_network()
} # End of testing()
 
#######################################################################
## Function "init" ##
645,8 → 643,7
IPADDR=$PUBLIC_IP
NETMASK=$PUBLIC_NETMASK
GATEWAY=$PUBLIC_GATEWAY
DNS1=$DNS1
DNS2=$DNS2
DNS1=127.0.0.1
RESOLV_MODS=yes
ONBOOT=yes
METRIC=10
1475,7 → 1472,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=/run/vnstat/vnstat.pid?g" /lib/systemd/system/vnstat.service
$SED "s?^PIDFILE=.*?PIDFILE=/var/run/vnstat/vnstat.pid?g" /lib/systemd/system/vnstat.service
} # End of vnstat()
 
###################################################################
2212,6 → 2209,7
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
2375,13 → 2373,13
exit 0
;;
-i | --install)
for func in license testing_system
for func in license testing
do
header_install
$func
if [ $DEBUG_ALCASAR == "on" ]
then
echo "*** 'debug' : end of function '$func' ***"
echo "*** 'debug' : end of install '$func' ***"
read
fi
done
2451,12 → 2449,12
fi
mode="update"
fi
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
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
do
$func
if [ $DEBUG_ALCASAR == "on" ]
then
echo "*** 'debug' : end of function '$func' ***"
echo "*** 'debug' : end of install '$func' ***"
read
fi
done