dnsmasq: use ubus signalling in ntp hotplug script
Use ubus process signalling instead of 'kill pidof dnsmasq' for SIGHUP signalling to dnsmasq when ntp says time is valid. Signed-off-by: Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
This commit is contained in:
parent
749918911d
commit
c914fa04a3
1 changed files with 3 additions and 3 deletions
|
@ -1,5 +1,7 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
. /lib/functions/procd.sh
|
||||||
|
|
||||||
TIMEVALIDFILE="/var/state/dnsmasqsec"
|
TIMEVALIDFILE="/var/state/dnsmasqsec"
|
||||||
|
|
||||||
[ "$ACTION" = stratum ] || exit 0
|
[ "$ACTION" = stratum ] || exit 0
|
||||||
|
@ -7,8 +9,6 @@ TIMEVALIDFILE="/var/state/dnsmasqsec"
|
||||||
[ -f "$TIMEVALIDFILE" ] || {
|
[ -f "$TIMEVALIDFILE" ] || {
|
||||||
echo "ntpd says time is valid" >$TIMEVALIDFILE
|
echo "ntpd says time is valid" >$TIMEVALIDFILE
|
||||||
/etc/init.d/dnsmasq enabled && {
|
/etc/init.d/dnsmasq enabled && {
|
||||||
pid=$(pidof dnsmasq)
|
procd_send_signal dnsmasq
|
||||||
[ "$(readlink /proc/$pid/exe)" = "/usr/sbin/dnsmasq" ] && kill -SIGHUP $pid \
|
|
||||||
|| /etc/init.d/dnsmasq restart
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue