From 8f961c1aaa5eb370af6d5a7dd1d0f4dc66d35b62 Mon Sep 17 00:00:00 2001 From: jacobsalmela Date: Fri, 17 Jul 2015 13:05:38 -0500 Subject: [PATCH] resolves #22 This lets dnsmasq re-read the hosts file without disturbing the daemon. So any new entries can be used as soon as gravity.sh is finished running --- gravity.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gravity.sh b/gravity.sh index 5ecd19d..919ebac 100755 --- a/gravity.sh +++ b/gravity.sh @@ -106,8 +106,9 @@ function gravity_advanced() echo "255.255.255.255 broadcasthost" | cat - $origin/$accretionDisc > $origin/latent.$accretionDisc && mv $origin/latent.$accretionDisc $origin/$accretionDisc echo "127.0.0.1 localhost" | cat - $origin/$accretionDisc > $origin/latent.$accretionDisc && mv $origin/latent.$accretionDisc $origin/$accretionDisc echo "127.0.0.1 $(hostname)" | cat - $origin/$accretionDisc > $origin/latent.$accretionDisc && mv $origin/latent.$accretionDisc $origin/$accretionDisc - # Copy the file so dnsmasq can use it + # Copy the file over as /etc/hosts so dnsmasq can use it sudo cp $origin/$accretionDisc $adList + kill -HUP $(pidof dnsmasq) } # Whitelist (if applicable) then remove duplicates and format for dnsmasq