Brisbane Web Developer
Posted on April 8, 2024
Summary
Location Changer to automatically activate the network interface depending on the current Wi-Fi network, stopped working.
Solution
Revise the way to extract the current Wi-Fi network :
/usr/local/bin/locationchanger
======
# SSID=`/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | grep ' SSID' | cut -d : -f 2- | sed 's/^[ ]*//'`
SSID=`networksetup -listallhardwareports | awk '/Wi-Fi/{getline; print $2}' | xargs networksetup -getairportnetwork | sed 's/[^:]*: //'`
Reference
💖 💪 🙅 🚩
Brisbane Web Developer
Posted on April 8, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.