Last active
July 19, 2017 07:13
-
-
Save Neal/e725a38b60f814c8565117fca40ee265 to your computer and use it in GitHub Desktop.
"Forget" all known open wifi networks
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
import os | |
import plistlib | |
pl = plistlib.readPlist('/Library/Preferences/SystemConfiguration/com.apple.airport.preferences.plist') | |
for key, network in pl['KnownNetworks'].items(): | |
if network['SecurityType'] == 'Open': | |
os.system('networksetup -removepreferredwirelessnetwork en0 "{}"'.format(network['SSIDString'])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment