Last active
January 4, 2022 17:18
-
-
Save dzintars/2670cadf4d6ca4e969b786391d226bfc to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
# Author: Dzintars Klavins | |
# This script will delete all network connections and devices. | |
# WARNING!!! Network connection will be lost! | |
# Delete all existing connections. | |
# All credits to: https://www.rene-pickhardt.de/index.html%3Fp=1955.html | |
for i in `nmcli c | \ | |
grep -o -- "[0-9a-fA-F]\{8\}-[0-9a-fA-F]\{4\}-[0-9a-fA-F]\{4\}-[0-9a-fA-F]\{4\}-[0-9a-fA-F]\{12\}"` ; \ | |
do nmcli connection delete uuid $i ; \ | |
done | |
# Delete all devices. | |
for i in `nmcli d | \ | |
grep -o -- "[0-9a-fA-F]\{8\}-[0-9a-fA-F]\{4\}-[0-9a-fA-F]\{4\}-[0-9a-fA-F]\{4\}-[0-9a-fA-F]\{12\}"` ; \ | |
do nmcli device delete uuid $i ; \ | |
done | |
nmcli device -show | |
nmcli connection -show |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment