From: Peter Wagner Date: Mon, 6 Mar 2017 08:20:28 +0000 (+0100) Subject: ntpd: only restart ntpd when the wan interface comes up and ntpd is enabled X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=228764bfe8b439e6abbd54eec3026a038e3c7a9c;p=openwrt-packages.git ntpd: only restart ntpd when the wan interface comes up and ntpd is enabled Signed-off-by: Peter Wagner --- diff --git a/net/ntpd/files/ntpd.hotplug b/net/ntpd/files/ntpd.hotplug index 975be751e..36cbe1597 100644 --- a/net/ntpd/files/ntpd.hotplug +++ b/net/ntpd/files/ntpd.hotplug @@ -1,10 +1,11 @@ +#!/bin/sh + NAME=ntpd -CONFIG=/etc/ntp.conf -COMMAND=/sbin/$NAME +COMMAND=/etc/init.d/$NAME [ "$ACTION" = "ifup" -a "$INTERFACE" = "wan" ] && { - [ -x $COMMAND ] && [ -r $CONFIG ] && { + $COMMAND enabled && { killall ntpd - /etc/init.d/ntpd start + $COMMAND start } & }