ntpd: only restart ntpd when the wan interface comes up and ntpd is enabled
authorPeter Wagner <tripolar@gmx.at>
Mon, 6 Mar 2017 08:20:28 +0000 (09:20 +0100)
committerPeter Wagner <tripolar@gmx.at>
Mon, 6 Mar 2017 08:20:28 +0000 (09:20 +0100)
Signed-off-by: Peter Wagner <tripolar@gmx.at>
net/ntpd/files/ntpd.hotplug

index 975be751ec78a189091eaaa7d7c630b09303e5ea..36cbe15976aece6106d15ce40ecd3375b6610827 100644 (file)
@@ -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
         } &
 }