odhcpd: Fix dnsmasq re-reading hostfile

Depending on the dhcp uci config pidof dnsmasq can return
multiple pids. Fix re-reading of the hostfile by dnsmasq in
such case by sending SIGHUP signal to each of the returned
pids.

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
This commit is contained in:
Hans Dedecker 2016-11-17 13:34:34 +01:00
parent 942904f7b9
commit a7c2310278
2 changed files with 5 additions and 2 deletions

View file

@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=odhcpd
PKG_VERSION:=2016-11-21
PKG_VERSION:=2016-12-13
PKG_RELEASE=$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz

View file

@ -2,4 +2,7 @@
# Make dnsmasq reread hostfile
pid=$(pidof dnsmasq)
[ "$(readlink /proc/$pid/exe)" = "/usr/sbin/dnsmasq" ] && kill -SIGHUP $pid
for i in $pid; do
[ "$(readlink /proc/$i/exe)" = "/usr/sbin/dnsmasq" ] && kill -SIGHUP $i
done