Amend Location Changer not working with macOS 14.4

Brisbane Web Developer - Apr 8 - - Dev Community

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/[^:]*: //'`
Enter fullscreen mode Exit fullscreen mode

Reference

. . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player