# dhcpcd -e NTP_CONF=/usr/pkg/etc/ntpd.conf
# or by adding this to /etc/dhcpcd.enter-hook
# NTP_CONF=/usr/pkg/etc/ntpd.conf
-# to use openntpd from pkgsrc instead of the system provided ntp.
+# to use OpenNTPD instead of the default NTP.
if type invoke-rc.d >/dev/null 2>&1; then
# Debian has a seperate file for DHCP config to avoid stamping on
: ${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}
+
+# If we have installed OpenNTPD but not NTP then prefer it
+# XXX If both exist then update both?
+if [ -z "$NTP_CONF" -a -e /etc/ntpd.conf -a ! -e /etc/ntp.conf ]; then
+ : ${NTP_CONF:=/etc/ntpd.conf}
+else
+ : ${NTP_CONF:=/etc/ntp.conf}
+fi
+
+ntp_conf=${NTP_CONF}
NL="
"
done
if [ -e /etc/arch-release ]; then
_service_status="[ -e /var/run/daemons/\$1 ]"
+ elif [ "$x" = "/etc/rc.d" -a -e /etc/rc.d/rc.subr ]; then
+ _service_status="$x/\$1 check 1>/dev/null 2>&1"
fi
fi