ntpdate revision 1.2
1#!/bin/sh 2# 3# $NetBSD: ntpdate,v 1.2 2000/03/11 20:10:21 veego Exp $ 4# 5 6# PROVIDE: ntpdate 7# REQUIRE: syslogd network 8 9. /etc/rc.subr 10. /etc/rc.conf 11 12name="ntpdate" 13start_precmd="checkyesno ntpdate" 14start_cmd="ntpdate_start" 15stop_cmd=":" 16 17ntpdate_start() 18{ 19 if [ -z "$ntpdate_hosts" ]; then 20 ntpdate_hosts=`awk ' 21 /^server[ \t]*127.127/ {next} 22 /^(server|peer)/ {print $2} 23 ' </etc/ntp.conf` 24 fi 25 if [ -n "$ntpdate_hosts" ]; then 26 echo "Setting date via ntp." 27 ntpdate -b -s $ntpdate_hosts 28 fi 29} 30 31run_rc_command "$1" 32