Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#! /usr/bin/env python3
import sys
# if the dns server of the wireguard are showed in the resolve.conf, then we skim off other servers to make sure the wireguard has the highest priority.
with open("/etc/resolv.conf") as f:
old_resolv = f.read()
if "10.56.100.1" in old_resolv:
with open("/etc/resolv.conf", "w") as f:
f.write("# generated by /etc/NetworkManager/dispatcher.d/refresh_dns.py\nnameserver 10.56.100.1\n")
#! /bin/bash
python3 /etc/NetworkManager/dispatcher.d/refresh_dns.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.