From 3c55e93eb27a41acae2947414ea3818a6289711d Mon Sep 17 00:00:00 2001 From: steve Date: Fri, 2 Jun 2006 09:57:15 +0000 Subject: [PATCH] 2006-06-02 09:57:15 by steve Reload DNSMasq if it is installed after modifying /etc/hosts. --- etc/hook.d/50-setup-hostname | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/etc/hook.d/50-setup-hostname b/etc/hook.d/50-setup-hostname index 18b6a40..f1447d4 100755 --- a/etc/hook.d/50-setup-hostname +++ b/etc/hook.d/50-setup-hostname @@ -49,5 +49,18 @@ if [[ -z "${dhcp}" ]]; then : else echo "${ip} ${hostname}" >> /etc/hosts + + # + # If we've updated the /etc/hosts file on the host machine + # and there is an installation of dnsmasq installed then + # reload it. + # + # This will let the local LAN clients lookup the new address. + # + if [ -x /usr/sbin/dnsmasq ] ; + if [ -e /var/run/dnsmasq.pid ]; then + kill -HUP `cat /var/run/dnsmasq.pid` + fi + fi fi fi