Last active
January 18, 2023 16:21
-
-
Save fbouynot/c01328b2702a70ba901801f3b1b9d427 to your computer and use it in GitHub Desktop.
etc_NetworkManager_dispatcher.d_wg0.conf autoreload wg profile in network manager when changing network
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
echo "Receive event from ${DEVICE_IFACE:-dummy} ${NM_DISPATCHER_ACTION:-dummy} " >> /tmp/dispatch.log | |
[[ "${DEVICE_IFACE:-dummy}" = "wg0" ]] && [[ "${NM_DISPATCHER_ACTION:-dummy}" = "up" ]] && { | |
systemctl restart systemd-resolved | |
resolvectl dns enp0s25 "1.1.1.2#security.cloudflare-dns.com 1.0.0.2#security.cloudflare-dns.com 2606:4700:4700::1112#security.cloudflare-dns.com 2606:4700:4700::1002#security.cloudflare-dns.com" | |
resolvectl domain enp0s25 ~. | |
resolvectl dnsovertls wg0 yes | |
resolvectl dnsovertls enp0s25 yes | |
resolvectl dnssec wg0 no | |
resolvectl dnssec enp0s25 yes | |
} >> /tmp/dispatch.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment