reworked on error code, create associated doc, module list checks

This commit is contained in:
levasseur
2021-07-12 12:25:26 +02:00
parent 09c94af407
commit 573c2cde5c
10 changed files with 179 additions and 146 deletions

View File

@@ -5,7 +5,7 @@
# * NTPSERVERS: list of NTP servers
# ------------------------------------------------------------------------------
export VER_conf_ntp="0.0.5"
export VER_conf_ntp="0.0.6"
conf_ntp()
{
@@ -25,11 +25,11 @@ conf_ntp()
installfile ntp.conf $dest
local line=""
for srv in $NTPSERVERS; do
line="${line}server $srv iburst\n"
line="${line}server $srv iburst\n"
done
sed -i -e "s/@SERVERLIST@/$line/" $dest &&
echo "# Generated on $(stdtime)" >> $dest &&
mv -fv $dest /etc/ntp.conf
echo "# Generated on $(stdtime)" >> $dest &&
mv -fv $dest /etc/ntp.conf
prnt I "Démarrage du service ntp..."
svc_start ntp
@@ -39,10 +39,10 @@ conf_ntp()
precheck_conf_ntp()
{
if [[ -z $NTPSERVERS ]]; then
prnt E "Pas de serveur NTP configuré !"
die 5
prnt E "Pas de serveur NTP configuré !"
die 151
else
prnt m "Les serveurs ntp utilisés seront : $NTPSERVERS"
prnt m "Les serveurs ntp utilisés seront : $NTPSERVERS"
fi
}