dnsmasq: dnssec time handling uses ntpd hotplug
[openwrt/staging/lynxis/omap.git] / package / network / services / dnsmasq / files / dnsmasqsec.hotplug
1 #!/bin/sh
2
3 TIMEVALIDFILE="/var/state/dnsmasqsec"
4
5 [ "$ACTION" = stratum ] || exit 0
6
7 [ -f "$TIMEVALIDFILE" ] || {
8 echo "ntpd says time is valid" >$TIMEVALIDFILE
9 /etc/init.d/dnsmasq enabled && {
10 pid=$(pidof dnsmasq)
11 [ "$(readlink /proc/$pid/exe)" = "/usr/sbin/dnsmasq" ] && kill -SIGHUP $pid \
12 || /etc/init.d/dnsmasq restart
13 }
14 }