projects
/
oweals
/
openwrt.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
add ntpclient hotplug script from whiterussian
[oweals/openwrt.git]
/
openwrt
/
package
/
ntpclient
/
files
/
ntpclient.init
1
#!/bin/sh
2
server=$(nvram get ntp_server)
3
case "$ACTION" in
4
ifup)
5
ps x | grep '[n]tpclient' >&- || {
6
route -n 2>&- | grep '^0.0.0.0' >&- && /usr/sbin/ntpclient -c 1 -s -h ${server:-pool.ntp.org} &
7
}
8
;;
9
ifdown)
10
route -n 2>&- | grep '^0.0.0.0' >&- || killall ntpclient 2>&- >&- ;;
11
esac