Created
February 18, 2015 10:50
-
-
Save frafra/ec9e7954c458e5c600b1 to your computer and use it in GitHub Desktop.
Remove manual DNS entries from active connections using nmcli
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 | |
for id in $(nmcli -t -f UUID c s -a) | |
do | |
dnss=$(nmcli -t -f ipv4.dns c s $id | cut -d: -f2- | tr -d ,) | |
for dns in $dnss | |
do | |
nmcli c m $id -ipv4.dns 0 | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment