Skip to content

Instantly share code, notes, and snippets.

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 =
if "" in old_resolv:
with open("/etc/resolv.conf", "w") as f:
f.write("# generated by /etc/NetworkManager/dispatcher.d/\nnameserver\n")
#! /bin/bash
python3 /etc/NetworkManager/dispatcher.d/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment