diff options
Diffstat (limited to 'openwrt')
-rw-r--r-- | openwrt/package/ntpclient/files/ntpclient.init | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/openwrt/package/ntpclient/files/ntpclient.init b/openwrt/package/ntpclient/files/ntpclient.init index a8944c60e..3a2118420 100644 --- a/openwrt/package/ntpclient/files/ntpclient.init +++ b/openwrt/package/ntpclient/files/ntpclient.init @@ -1,7 +1,8 @@ #!/bin/sh -case "$ACTION" in +ntp_server=$(nvram get ntp_server) +case "${ACTION:-ifup}" in ifup) - ps x | grep '[n]tpclient' >&- || { + ps x | grep 'bin/[n]tpclient' >&- || { route -n 2>&- | grep '^0.0.0.0' >&- && /usr/sbin/ntpclient -c 1 -s -h ${ntp_server:-pool.ntp.org} & } ;; |