summaryrefslogtreecommitdiffstats
path: root/openwrt/package
diff options
context:
space:
mode:
Diffstat (limited to 'openwrt/package')
-rw-r--r--openwrt/package/ntpclient/files/ntpclient.init5
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} &
}
;;