fix openntpd hotplug script (based on patch from #3027)
[packages.git] / net / openntpd / files / ntpd.hotplug
1 case "${ACTION:-ifup}" in
2         ifup)
3                 ps | grep -v 'grep' | grep -v '20-ntpd' | grep -q 'ntpd' || {
4                         route -n 2>/dev/null | grep -q '^0.0.0.0' && {
5                                 /etc/init.d/ntpd enabled && /etc/init.d/ntpd start 2>/dev/null >/dev/null
6                         }
7                 }
8         ;;
9         ifdown)
10                 route -n 2>/dev/null | grep -q '^0.0.0.0' || /etc/init.d/ntpd stop 2>/dev/null >/dev/null
11         ;;
12 esac