From: Travis Kemen Date: Thu, 28 Jun 2007 21:04:47 +0000 (+0000) Subject: add ntpclient count option and exit after a successful sync closes #1835 Thanks Carlo... X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=a681ab59259d75c2537a2f339102a16a4065eaf0;p=openwrt%2Fsvn-archive%2Fpackages.git add ntpclient count option and exit after a successful sync closes #1835 Thanks Carlos Sobrinho SVN-Revision: 7763 --- diff --git a/net/ntpclient/files/ntpclient.init b/net/ntpclient/files/ntpclient.init index 0689a7500..306c2816f 100644 --- a/net/ntpclient/files/ntpclient.init +++ b/net/ntpclient/files/ntpclient.init @@ -3,6 +3,7 @@ . /etc/functions.sh +DONE=0 config_cb() { local cfg="$CONFIG_SECTION" local cfgtype @@ -12,10 +13,12 @@ config_cb() { ntp_client) config_get hostname $cfg hostname config_get port $cfg port - + config_get count $cfg count + + [ "$DONE" = "1" ] && exit 0 ps x | grep 'bin/[n]tpclient' >&- || { route -n 2>&- | grep '^0.0.0.0' >&- && { - /usr/sbin/ntpclient -h $hostname -p ${port:-123} 2>&- >&- + /usr/sbin/ntpclient -c ${count:-1} -s -h $hostname -p ${port:-123} 2>&- >&- && DONE=1 } } ;;