added conf_ntp, few typos
This commit is contained in:
28
modules/conf_ntp.sh
Normal file
28
modules/conf_ntp.sh
Normal file
@@ -0,0 +1,28 @@
|
||||
# NTP
|
||||
|
||||
conf_ntp()
|
||||
{
|
||||
prnt I "Installation du fichier de configuration de NTP."
|
||||
dest="/etc/ntp.conf.work"
|
||||
backupdist /etc/ntp.conf
|
||||
installfile ntp.conf $dest
|
||||
local line=""
|
||||
for srv in $NTPSERVERS; do
|
||||
line="${line}server $srv iburst\n"
|
||||
done
|
||||
sed -i -e "s/@SERVERLIST@/$line/" $dest &&
|
||||
echo "# Generated on $(date --rfc-3339=seconds)" >> $dest &&
|
||||
mv -fv $dest /etc/ntp.conf
|
||||
}
|
||||
|
||||
# NTP
|
||||
precheck_conf_ntp()
|
||||
{
|
||||
if [[ ! $NTPSERVERS ]]; then
|
||||
prnt E "Pas de serveur NTP configuré !"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
export -f conf_ntp
|
||||
export -f precheck_conf_ntp
|
||||
Reference in New Issue
Block a user