various fixes and updates
[distro-setup] / trusted-network
index d227137732b56c148ee2cd4f15284a731b4f53dc..7cd754cf861476854f5ab6fe69f7e076b37da98a 100755 (executable)
@@ -8,6 +8,9 @@ trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
 # Usage: run when switching from an untrusted network like public wifi
 # to a trusted one.
 
-rm -f /etc/dnsmasq.d/untrusted-network.conf
+if [[ -e /etc/dnsmasq.d/untrusted-network.conf ]]; then
+  rm -f /etc/dnsmasq.d/untrusted-network.conf
 
-systemctl reload dnsmasq
+  nscd -i hosts
+  systemctl restart dnsmasq
+fi