fix openswan patch
[openwrt/openwrt.git] / openwrt / package / ntpclient / files / ntpclient.init
1 #!/bin/sh
2 case "$ACTION" in
3 ifup)
4 ps x | grep '[n]tpclient' >&- || {
5 route -n 2>&- | grep '^0.0.0.0' >&- && /usr/sbin/ntpclient -c 1 -s -h ${ntp_server:-pool.ntp.org} &
6 }
7 ;;
8 ifdown)
9 route -n 2>&- | grep '^0.0.0.0' >&- || killall ntpclient 2>&- >&- ;;
10 esac