2 # Copyright (C) 2006 OpenWrt.org
8 local cfg
="$CONFIG_SECTION"
10 config_get cfgtype
"$cfg" TYPE
12 # initial frequency offset, if configured
15 config_get freq
$cfg freq
17 if [ ! "$freq" = "" ]; then
18 adjtimex
-f $freq >/dev
/null
25 config_get hostname
$cfg hostname
26 config_get port
$cfg port
27 config_get count
$cfg count
29 [ "$DONE" = "1" ] && exit 0
30 ps |
grep 'bin/[n]tpclient' >&- ||
{
31 route
-n 2>&- |
grep '^0.0.0.0' >&- && {
32 /usr
/sbin
/ntpclient
-c ${count:-1} -s -h $hostname -p ${port:-123} 2>&- >&- && DONE
=1
38 case "${ACTION:-ifup}" in
40 config_load ntpclient
&
43 route
-n 2>&- |
grep '^0.0.0.0' >&- || killall ntpclient
2>&- >&-