Merge 2.4 patches to 2.6 kernel.
[openwrt.git] / openwrt / package / ntpclient / files / ntpclient.init
index 16a75ca..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.024559 seconds and 4 git commands to generate.