openwrt/package/network/services/dnsmasq/files/dnsmasqsec.hotplug
Kevin Darbyshire-Bryant ed91d72eac dnsmasq: hotplug script tidyup
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>
2020-05-10 20:40:30 +01:00

12 lines
256 B
Plaintext

TIMEVALIDFILE="/var/state/dnsmasqsec"
[ "$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
}
}