dnsmasq: hotplug script tidyup
authorKevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Sun, 10 May 2020 12:47:05 +0000 (13:47 +0100)
committerKevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Sun, 10 May 2020 19:40:30 +0000 (20:40 +0100)
Hotplug scripts are sourced so the #!/bin/sh is superfluous/deceptive.
Re-arrange script to only source 'procd' if we get to the stage of
needing to signal the process, reduce hotplug processing load a little.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
package/network/services/dnsmasq/Makefile
package/network/services/dnsmasq/files/dnsmasqsec.hotplug

index d07804bad0755be4c34c5e0c36f2e652e572573b..f328d51d2cbc0f0b5d42bac1a12a65c026bb263d 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=dnsmasq
 PKG_UPSTREAM_VERSION:=2.81
 PKG_VERSION:=$(subst test,~~test,$(subst rc,~rc,$(PKG_UPSTREAM_VERSION)))
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_UPSTREAM_VERSION).tar.xz
 PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq
index 781d5337348bb8e927bd15f1caac94a5e7a9ba63..71f5e68b2ddc248f3a7d83a129566b1fab424a91 100644 (file)
@@ -1,14 +1,11 @@
-#!/bin/sh
-
-. /lib/functions/procd.sh
-
 TIMEVALIDFILE="/var/state/dnsmasqsec"
 
-[ "$ACTION" = stratum ] || exit 0
+[ "$ACTION" = "stratum" ] || exit 0
 
 [ -f "$TIMEVALIDFILE" ] || {
        echo "ntpd says time is valid" >$TIMEVALIDFILE
        /etc/init.d/dnsmasq enabled && {
+               . /lib/functions/procd.sh
                procd_send_signal dnsmasq '*' INT
        }
 }