commit 228764bfe8b439e6abbd54eec3026a038e3c7a9c
parent 836f875a3341144f259ba720b28961bf8ee95042
Author: Peter Wagner <tripolar@gmx.at>
Date: Mon, 6 Mar 2017 09:20:28 +0100
ntpd: only restart ntpd when the wan interface comes up and ntpd is enabled
Signed-off-by: Peter Wagner <tripolar@gmx.at>
Diffstat:
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git 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
} &
}