move the drift file to /tmp since it gets written a fair amount, bump release and...
[openwrt/svn-archive/archive.git] / net / ntpd / files / ntpd.init
1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2006 OpenWrt.org
3
4 START=60
5
6 STEP_SERVERS="pool.ntp.org pool.ntp.org pool.ntp.org"
7 PIDFILE="/var/run/ntpd.pid"
8 TIMEOUT="2" # in seconds
9
10 start() {
11 # ln -sf /dev/ttyS0 /dev/gps0
12 # /usr/sbin/setgarmin -d /dev/gps -c /etc/setgarmin.conf
13 stop
14 for s in $STEP_SERVERS ; do
15 /usr/sbin/ntpdate -s -b -u -t "$TIMEOUT" "$s" && break
16 done
17 /usr/sbin/ntpd -g -p $PIDFILE
18 }
19
20 stop() {
21 [ -f "$PIDFILE" ] && kill $(cat "$PIDFILE") 2>/dev/null >/dev/null
22 }