2005-04-04 22:12:17 +00:00
|
|
|
#!/bin/sh
|
2005-11-07 01:12:51 +00:00
|
|
|
server=$(nvram get ntp_server)
|
|
|
|
case "$ACTION" in
|
|
|
|
ifup)
|
|
|
|
ps x | grep '[n]tpclient' >&- || {
|
2006-01-02 11:29:30 +00:00
|
|
|
route -n 2>&- | awk '$1 == "0.0.0.0"' >&- && /usr/sbin/ntpclient -c 1 -s -h ${server:-pool.ntp.org} &
|
2005-11-07 01:12:51 +00:00
|
|
|
}
|
|
|
|
;;
|
|
|
|
ifdown)
|
2006-01-02 11:29:30 +00:00
|
|
|
route -n 2>&- | awk '$1 == "0.0.0.0"' >&- || killall ntpclient 2>&- >&- ;;
|
2005-11-07 01:12:51 +00:00
|
|
|
esac
|