odhcpd: Fix dnsmasq re-reading hostfile
[openwrt/staging/stintel.git] / package / network / services / odhcpd / files / odhcpd-update
index 20980f2228cbffd32608b4fc29733ea363784f8d..5f800aac60a882bc9284491cda21c465b7a71abf 100755 (executable)
@@ -1,3 +1,8 @@
 #!/bin/sh
 # Make dnsmasq reread hostfile
-killall -SIGHUP dnsmasq
+
+pid=$(pidof dnsmasq)
+
+for i in $pid; do
+       [ "$(readlink /proc/$i/exe)" = "/usr/sbin/dnsmasq" ] && kill -SIGHUP $i
+done