aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/contrib/examples/systemd-resolved/systemd-resolve.bash
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-05-21 04:08:23 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-05-21 16:43:56 +0200
commitec1323b231004c7bcb6f9e194f8e1799b56f212e (patch)
tree1a0d52e6d904daa0c226fba0ca9ebd5845900045 /contrib/examples/systemd-resolved/systemd-resolve.bash
parentcompat: work around qcom 4.9 backports (diff)
downloadwireguard-monolithic-historical-ec1323b231004c7bcb6f9e194f8e1799b56f212e.tar.xz
wireguard-monolithic-historical-ec1323b231004c7bcb6f9e194f8e1799b56f212e.zip
contrib: add systemd-resolved workaround script
This is for systems that don't have systemd 239, which supports resolvconf.
Diffstat (limited to 'contrib/examples/systemd-resolved/systemd-resolve.bash')
-rw-r--r--contrib/examples/systemd-resolved/systemd-resolve.bash11
1 files changed, 11 insertions, 0 deletions
diff --git a/contrib/examples/systemd-resolved/systemd-resolve.bash b/contrib/examples/systemd-resolved/systemd-resolve.bash
new file mode 100644
index 0000000..4ea1cf9
--- /dev/null
+++ b/contrib/examples/systemd-resolved/systemd-resolve.bash
@@ -0,0 +1,11 @@
+set_dns() {
+ [[ ${#DNS[@]} -gt 0 ]] || return 0
+ cmd systemd-resolve --interface="$INTERFACE" "${DNS[@]/#/--set-dns=}" --set-domain=~.
+ HAVE_SET_DNS=1
+}
+
+unset_dns() {
+ # We don't need to call --revert here, since the interface is being deleted
+ # anyway, and systemd-resolved knows about that.
+ return 0
+}