1
0
This repository has been archived on 2025-06-16. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
openwrt_archive/net/openntpd/files/ntpd.hotplug
2008-09-05 18:15:54 +00:00

13 lines
348 B
Plaintext

case "${ACTION:-ifup}" in
ifup)
ps | grep -v 'grep' | grep -v '20-ntpd' | grep -q 'ntpd' || {
route -n 2>/dev/null | grep -q '^0.0.0.0' && {
/etc/init.d/ntpd enabled && /etc/init.d/ntpd start 2>/dev/null >/dev/null
}
}
;;
ifdown)
route -n 2>/dev/null | grep -q '^0.0.0.0' || /etc/init.d/ntpd stop 2>/dev/null >/dev/null
;;
esac