Remove reundant quote.
[netbsd-mini2440.git] / etc / rc.d / ntpdate
blob94f4e1bbcc703d3ddc87451f1daf84cfab92dc72
1 #!/bin/sh
3 # $NetBSD: ntpdate,v 1.17 2004/10/11 15:00:51 christos Exp $
6 # PROVIDE: ntpdate
7 # REQUIRE: NETWORKING mountcritremote syslogd
9 $_rc_subr_loaded . /etc/rc.subr
11 name="ntpdate"
12 rcvar=$name
13 command="/usr/sbin/${name}"
14 start_cmd="ntpdate_start"
15 stop_cmd=":"
17 ntpdate_start()
19 if [ -z "$ntpdate_hosts" ]; then
20 ntpdate_hosts=$(awk '
21 /^#/ { next }
22 /^(server|peer)[ \t]*127.127/ { next }
23 /^(server|peer)/ { if ($2 ~ /^-[46]/)
24 print $3
25 else
26 print $2 }
27 ' </etc/ntp.conf)
29 if [ -n "$ntpdate_hosts" ]; then
30 echo "Setting date via ntp."
31 $command $rc_flags $ntpdate_hosts
35 load_rc_config $name
36 run_rc_command "$1"