dnsmasq: use ubus signalling in ntp hotplug script
[openwrt/openwrt.git] / package / network / services / dnsmasq / files / dnsmasqsec.hotplug
index 5c69314bd97590b7477ea32d2fbe8022ca307424..a155eb0f6e355376aafc55240c7a9cba74ccb5ec 100644 (file)
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+. /lib/functions/procd.sh
+
 TIMEVALIDFILE="/var/state/dnsmasqsec"
 
 [ "$ACTION" = stratum ] || exit 0
@@ -7,8 +9,6 @@ TIMEVALIDFILE="/var/state/dnsmasqsec"
 [ -f "$TIMEVALIDFILE" ] || {
        echo "ntpd says time is valid" >$TIMEVALIDFILE
        /etc/init.d/dnsmasq enabled && {
-               pid=$(pidof dnsmasq)
-               [ "$(readlink /proc/$pid/exe)" = "/usr/sbin/dnsmasq" ] && kill -SIGHUP $pid \
-               || /etc/init.d/dnsmasq restart
+               procd_send_signal dnsmasq
        }
 }