Skip to content

Instantly share code, notes, and snippets.

@brunerd
Last active September 28, 2024 19:41
Show Gist options
  • Save brunerd/3a3e12267c4a5bb98fd696f1604a556c to your computer and use it in GitHub Desktop.
Save brunerd/3a3e12267c4a5bb98fd696f1604a556c to your computer and use it in GitHub Desktop.
Get the per-network Private MAC Address Mode new for Sequoia
#get network SSID (can take hella long time ~6s but Sequoia broke networksetup -getairportnetwork method)
#https://snelson.us/2024/09/determining-a-macs-ssid-like-an-animal/
SSID=$(system_profiler -detailLevel basic SPAirPortDataType | awk '/Current Network Information:/ { getline; print substr($0, 13, (length($0) - 13)); exit }')
#find the pref in com.apple.wifi.known-networks, possible values are: off, static, rotating
PrivateMACAddressMode=$(/usr/libexec/PlistBuddy -c "print :wifi.network.ssid.'${SSID}':PrivateMACAddressModeUserSetting" /Library/Preferences/com.apple.wifi.known-networks.plist)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment