ntpd: only restart ntpd when the wan interface comes up and ntpd is enabled

Signed-off-by: Peter Wagner <tripolar@gmx.at>
This commit is contained in:
Peter Wagner 2017-03-06 09:20:28 +01:00
parent 836f875a33
commit 228764bfe8

View 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
} &
}