Prefer networksetup and skip root runs#30
Conversation
|
Turns out this breaks support for SSIDs with spaces in the name. It only matches the final " lastword". |
|
fix for SSIDs with spaces networksetup -listallhardwareports | awk '/Wi-Fi/{getline; print $2}' | xargs networksetup -getairportnetwork | sed 's/[^:]*: //' |
That worked for me. Thanks! |
Unfortunately this is broken as of MacOS 15.0. And I haven't been able to find any way to fix it without sudo, as every non-sudo command I've found lists the SSID as "<redacted>" |
|
Try |
|
I know this PR is still technically open so I'll mention that I have been trying to find a repeatable, non-root way to retrieve the active SSID (without introducing 2-3 seconds of latency as I've been using |
|
As this PR came up in my inbox, I'd like to share the working and faster solution I currently use in this script on MacOS 26.2 to get the active SSID: Hope that it is useful for you too. |
|
Hi, Yep - that's where I landed as well, but I used
Where the additional I've submitted PR #33 on this project but I have forked the patched script to my own repo at https://github.com/pbernicchi/locationchanger until a decision can be made by the original author on long-term maintenance. Happy to take it on as a transfer or standalone. |
Primarily I wanted to incorporate @amartignoni's simplification through
networksetupover use of a private API and implement a fix for issue #28 so that I had a one stop branch that would do what I needed.This covers both scenarios.
Closes #29