summaryrefslogtreecommitdiffstats
path: root/etc/rc.d/ntpdate
diff options
context:
space:
mode:
authorgordon <gordon@FreeBSD.org>2002-06-13 22:14:37 +0000
committergordon <gordon@FreeBSD.org>2002-06-13 22:14:37 +0000
commit9c5433cb225f7a4e56e87623ea2e4011179553a5 (patch)
tree3168589e209abd888b033397e3c46dee6131a116 /etc/rc.d/ntpdate
parent50d99cdfecd92f5323a18aa791a5b1cb9d8b7191 (diff)
downloadFreeBSD-src-9c5433cb225f7a4e56e87623ea2e4011179553a5.zip
FreeBSD-src-9c5433cb225f7a4e56e87623ea2e4011179553a5.tar.gz
Merge in all the changes that Mike Makonnen has been maintaining for a
while. This is only the script pieces, the glue for the build comes next. Submitted by: Mike Makonnen <makonnen@pacbell.net> Reviewed by: silence on -current and -hackers Prodded by: rwatson
Diffstat (limited to 'etc/rc.d/ntpdate')
-rwxr-xr-xetc/rc.d/ntpdate28
1 files changed, 20 insertions, 8 deletions
diff --git a/etc/rc.d/ntpdate b/etc/rc.d/ntpdate
index d0a8a18..37b1d07 100755
--- a/etc/rc.d/ntpdate
+++ b/etc/rc.d/ntpdate
@@ -1,29 +1,41 @@
#!/bin/sh
#
-# $NetBSD: ntpdate,v 1.5 2000/08/21 14:48:39 abs Exp $
+# $NetBSD: ntpdate,v 1.8 2002/03/22 04:16:39 lukem Exp $
+# $FreeBSD$
#
# PROVIDE: ntpdate
-# REQUIRE: NETWORK syslogd
+# REQUIRE: NETWORKING syslogd
+# KEYWORD: FreeBSD NetBSD
. /etc/rc.subr
name="ntpdate"
-rcvar=$name
-start_cmd="ntpdate_start"
-stop_cmd=":"
+rcvar=`set_rcvar`
+
+case `${CMD_OSTYPE}` in
+FreeBSD)
+ command="/usr/sbin/${name}"
+ command_args=">/dev/null 2>&1"
+ pidfile="/var/run/${name}.pid"
+ ;;
+NetBSD)
+ start_cmd="ntpdate_start"
+ stop_cmd=":"
+ ;;
+esac
ntpdate_start()
{
if [ -z "$ntpdate_hosts" ]; then
ntpdate_hosts=`awk '
- /^server[ \t]*127.127/ {next}
- /^(server|peer)/ {print $2}
+ /^server[ \t]*127.127/ {next}
+ /^(server|peer)/ {print $2}
' </etc/ntp.conf`
fi
if [ -n "$ntpdate_hosts" ]; then
echo "Setting date via ntp."
- ntpdate $ntpdate_flags $ntpdate_hosts
+ ntpdate $rc_flags $ntpdate_hosts
fi
}
OpenPOWER on IntegriCloud