unbound: improve NTP hotplug behavior when Unbound is disabled
authorEric Luehrsen <ericluehrsen@hotmail.com>
Fri, 23 Dec 2016 07:37:21 +0000 (02:37 -0500)
committerJo-Philipp Wich <jo@mein.io>
Sun, 5 Feb 2017 19:08:30 +0000 (20:08 +0100)
If Unbound was disabled and at later time enabled, then it
would operate in DNSSEC less-secure mode. When NTP hotplug
was called, the timestamp file was not updated. This was
found testing Unbound vs other tools (bind, dnsmasq).

Signed-off-by: Eric Luehrsen <ericluehrsen@hotmail.com>
net/unbound/files/unbound.ntpd

index 2f312d90cfbdc484a696d985f1ebe269af95f4c8..5c7191656d67a2da3471a07f1c589b327cd7cf9e 100755 (executable)
 
 ##############################################################################
 
-if [ "$ACTION" = stratum -a ! -f "$UNBOUND_TIMEFILE" ] \
-  && /etc/init.d/unbound enabled ; then
-  #
+if [ "$ACTION" = stratum -a ! -f "$UNBOUND_TIMEFILE" ] ; then
   echo "ntpd: $( date )" > $UNBOUND_TIMEFILE
-  /etc/init.d/unbound restart
+  /etc/init.d/unbound enabled && /etc/init.d/unbound restart
 fi
 
 ##############################################################################