Port ntpclient to -ng
git-svn-id: svn://svn.openwrt.org/openwrt/packages@4485 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
11
net/ntpclient/files/ntpclient.init
Normal file
11
net/ntpclient/files/ntpclient.init
Normal file
@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
ntp_server=$(nvram get ntp_server)
|
||||
case "${ACTION:-ifup}" in
|
||||
ifup)
|
||||
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} &
|
||||
}
|
||||
;;
|
||||
ifdown)
|
||||
route -n 2>&- | grep '^0.0.0.0' >&- || killall ntpclient 2>&- >&- ;;
|
||||
esac
|
Reference in New Issue
Block a user