Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions scripts/network.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ get_ssid()

ifname=$(_get_wifi_ifname)

# Only report a Wi-Fi network when the interface is actually associated. Otherwise the
# fallback below can surface a saved/preferred SSID (listpreferredwirelessnetworks) and
# show a stale name -- e.g. an old hotspot -- whenever Wi-Fi is off but the machine is
# online via Ethernet. Association state stays readable even though the SSID itself is
# gated behind Location Services on macOS 15+.
if [[ "$(ifconfig "$ifname" 2>/dev/null | awk '/status:/ {print $2}')" != "active" ]]; then
echo "$ethernet_label"
return
fi

# string manipulation required to remove the minor version of the macos version (e.g. x.y.z removes .z)
# this is required to prevent issues in version detection
#
Expand Down