@ralvarezOES I don't know of any mechanism that allows calling Objective-C code from a sh/bash/zsh script as can be done via Python. If you need to re-order Wi-Fi configurations and preserve any existing 802.1x configurations then the Python based scripts are the only ones that currently exist.
@ralvarezOES I don't know of any mechanism that allows calling Objective-C code from a sh/bash/zsh script as can be done via Python. If you need to re-order Wi-Fi configurations and preserve any existing 802.1x configurations then the Python based scripts are the only ones that currently exist.
Thanks for the quick reply. Ok, that's fine. This is pretty important unless I want to redesign our Wi-Fi to only have one SSID (Which I would love to, lol.)
So if I install macadmin-python on the employee MacBooks, do you have any pointers? Should I plan on an update schedule? Any options in the installer that are helpful?
Thanks for the quick reply. Ok, that's fine. This is pretty important unless I want to redesign our Wi-Fi to only have one SSID (Which I would love to, lol.)
So if I install macadmin-python on the employee MacBooks, do you have any pointers? Should I plan on an update schedule? Any options in the installer that are helpful?
You actually ought to keep a second SSID or BSSID available, it's a great fallback if your authentication on your preferred wireless ever fails (certificate errors, etc).
Get your Wi-Fi interface:
wifi=$(networksetup -listallhardwareports | awk '/Wi-Fi/{getline; print $2 }')
Forget the network:
networksetup -removepreferredwirelessnetwork $wifi "$SSID"
Then re-add it at index 0:
networksetup -addpreferredwirelessnetworkatindex $wifi "$SSID" 0 $Security_Type [password]
Iterate for multiple SSIDs, etc.
Based on usage and OS versions, you might consider also toggling Wi-Fi to force the changes.
You actually ought to keep a second SSID or BSSID available, it's a great fallback if your authentication on your preferred wireless ever fails (certificate errors, etc).
Get your Wi-Fi interface:
wifi=$(networksetup -listallhardwareports | awk '/Wi-Fi/{getline; print $2 }')
Forget the network:
networksetup -removepreferredwirelessnetwork $wifi "$SSID"
Then re-add it at index 0:
networksetup -addpreferredwirelessnetworkatindex $wifi "$SSID" 0 $Security_Type [password]
Iterate for multiple SSIDs, etc.
Based on usage and OS versions, you might consider also toggling Wi-Fi to force the changes.
@pete_c Your method will break any 802.1x configuration associated with a SSID that's "moved"