iankelling.org
/
git
/
distro-setup
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
minor fixes
[distro-setup]
/
untrusted-network
diff --git
a/untrusted-network
b/untrusted-network
index 3d8ac97d668cf3ebe7a530f9096a6c543161f90c..b4fdb70e0e5304af943e683d34d0074d77c56e2b 100755
(executable)
--- a/
untrusted-network
+++ b/
untrusted-network
@@
-8,7
+8,8
@@
trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
# Usage: use when switching from a trusted network to an untrusted one,
# like public wifi.
# Usage: use when switching from a trusted network to an untrusted one,
# like public wifi.
-cat >/etc/dnsmasq.d/untrusted-network.conf <<'EOF'
+if [[ ! -s /etc/dnsmasq.d/untrusted-network.conf ]]; then
+ cat >/etc/dnsmasq.d/untrusted-network.conf <<'EOF'
server=8.8.4.4
server=8.8.8.8
server=2001:4860:4860::8844
server=8.8.4.4
server=8.8.8.8
server=2001:4860:4860::8844
@@
-18,4
+19,6
@@
no-resolv
stop-dns-rebind
EOF
stop-dns-rebind
EOF
-systemctl reload dnsmasq
+ nscd -i hosts
+ systemctl restart dnsmasq
+fi