From 228764bfe8b439e6abbd54eec3026a038e3c7a9c Mon Sep 17 00:00:00 2001 From: Peter Wagner Date: Mon, 6 Mar 2017 09:20:28 +0100 Subject: [PATCH] ntpd: only restart ntpd when the wan interface comes up and ntpd is enabled Signed-off-by: Peter Wagner --- net/ntpd/files/ntpd.hotplug | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/net/ntpd/files/ntpd.hotplug b/net/ntpd/files/ntpd.hotplug index 975be751ec..36cbe15976 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 } & } -- 2.30.2