new conf files + fix bug in conf_ntp with devuan 5, fix a bug with early debian/devuan version, added git support for profile
This commit is contained in:
@@ -24,23 +24,37 @@ conf_ntp()
|
||||
prnt I "Installing ntp daemon..."
|
||||
pkginst ntp
|
||||
prnt I "Stopping service ntp..."
|
||||
svc_stop ntp
|
||||
if [[ -n $NTP_SERV ]]; then
|
||||
svc_stop $NTP_SERV
|
||||
else
|
||||
svc_stop ntp
|
||||
fi
|
||||
|
||||
if [[ -n $NTP_SERV ]]; then
|
||||
local conf_file="/etc/$NTP_SERV/ntp.conf"
|
||||
else
|
||||
local conf_file="/etc/ntp.conf"
|
||||
fi
|
||||
|
||||
prnt I "Installing NTP configuration file..."
|
||||
local dest="/etc/ntp.conf.work"
|
||||
backup_dist /etc/ntp.conf
|
||||
tag_file $dest
|
||||
local dest="${conf_file}.work"
|
||||
backup_dist $conf_file
|
||||
install_file ntp.conf $dest
|
||||
tag_file $dest
|
||||
local line=""
|
||||
for srv in $NTP_SERVERS; do
|
||||
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
|
||||
mv -fv $dest $conf_file
|
||||
|
||||
prnt I "Starting service ntp..."
|
||||
svc_start ntp
|
||||
|
||||
if [[ -n $NTP_SERV ]]; then
|
||||
svc_start $NTP_SERV
|
||||
else
|
||||
svc_start ntp
|
||||
fi
|
||||
sleep 2 # short sleep so we're sure daemon is ready
|
||||
ntptime
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user