Last active
January 27, 2018 07:58
-
-
Save lucascantor/c104f6129e0445bd15f901de3ab63076 to your computer and use it in GitHub Desktop.
Remove a specific wifi network SSID from the list of remembered wifi networks
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 | |
for interface in $(networksetup -listnetworkserviceorder | grep Hardware | awk '/Wi-Fi/ { print $NF }' | awk -F ")" '{ print $1 }') | |
do | |
echo "Forgetting non-preferred SSID for $interface" | |
networksetup -removepreferredwirelessnetwork $interface <SSID to forget> | |
done | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment