# NTP_CONF=/usr/pkg/etc/ntpd.conf
# to use openntpd from pkgsrc instead of the system provided ntp.
-: ${ntpd_restart_cmd:=service_condcommand ntpd restart}
if type invoke-rc.d >/dev/null 2>&1; then
# Debian has a seperate file for DHCP config to avoid stamping on
# the master.
[ -e /var/lib/ntp ] || mkdir /var/lib/ntp
+ : ${ntp_service:=ntp}
: ${NTP_DHCP_CONF:=/var/lib/ntp/ntp.conf.dhcp}
fi
+: ${ntp_service:=ntpd}
+: ${ntp_restart_cmd:=service_condcommand $ntp_service restart}
ntp_conf_dir="$state_dir/ntp.conf"
ntp_conf=${NTP_CONF:-/etc/ntp.conf}
NL="
printf %s "$servers" >> "$cf"
echo "$signature_base_end${header:+ $from }$header" >> "$cf"
else
- [ -e "$ntp_conf" ] || return
+ [ -e "$ntp_conf" -a -e "$cf" ] || return
fi
# If we changed anything, restart ntpd
if change_file "$ntp_conf" "$cf"; then
- [ -n "$ntpd_restart_cmd" ] && eval $ntpd_restart_cmd
+ [ -n "$ntp_restart_cmd" ] && eval $ntp_restart_cmd
fi
}