aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/services/dnsmasq/files/dnsmasqsec.hotplug
diff options
context:
space:
mode:
Diffstat (limited to 'package/network/services/dnsmasq/files/dnsmasqsec.hotplug')
-rw-r--r--package/network/services/dnsmasq/files/dnsmasqsec.hotplug14
1 files changed, 14 insertions, 0 deletions
diff --git a/package/network/services/dnsmasq/files/dnsmasqsec.hotplug b/package/network/services/dnsmasq/files/dnsmasqsec.hotplug
new file mode 100644
index 0000000000..5c69314bd9
--- /dev/null
+++ b/package/network/services/dnsmasq/files/dnsmasqsec.hotplug
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+TIMEVALIDFILE="/var/state/dnsmasqsec"
+
+[ "$ACTION" = stratum ] || exit 0
+
+[ -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
+ }
+}