large init script cleanup and merge of whiterussian changes, new dnsmasq config handling
[openwrt.git] / package / ntpclient / files / ntpclient.init
index 923022b..a8944c6 100644 (file)
@@ -1,2 +1,10 @@
 #!/bin/sh
-/usr/sbin/ntpclient -c 1 -s -h pool.ntp.org &
+case "$ACTION" in
+       ifup)
+               ps x | grep '[n]tpclient' >&- || {
+                       route -n 2>&- | grep '^0.0.0.0' >&- && /usr/sbin/ntpclient -c 1 -s -h ${ntp_server:-pool.ntp.org} &
+               }
+               ;;
+       ifdown)
+               route -n 2>&- | grep '^0.0.0.0' >&- || killall ntpclient 2>&- >&- ;;
+esac
This page took 0.042057 seconds and 4 git commands to generate.