Closed sylwester- closed 3 years ago
Thanks for the report!
I've used locationchanger for years. I can echo the issue @sylwester- reported. Things just stopped under Big Sur. I manually reinstalled the script into /usr/local/bin (on top of my existing). Manually running sudo launchctl load ~/Library/LaunchAgents/LocationChanger.plist
has no effect. I can run the script and it will throw the location notification in system.log
but neither switches location nor fires the corresponding script in ~/.locations. Happy to help troubleshoot.
Looks like Big Sur stopped writing to com.apple.airport.preferences.plist
on Wi-Fi changes.
@pbernicchi could you confirm if changing /Library/Preferences/SystemConfiguration/com.apple.airport.preferences.plist
(line 13) in ~/Library/LaunchAgents/LocationChanger.plist
to /Library/Preferences/SystemConfiguration
makes it work again?
As for Load failed: 5: Input/output error
error (/c @sylwester-), it seems like Big Sur now loads plist's only when they are owned by the root
user. This should help:
sudo chown root:wheel ~/Library/LaunchAgents/LocationChanger.plist
sudo launchctl load ~/Library/LaunchAgents/LocationChanger.plist
I'll change the installation script to create that plist in the system library.
Though if it runs as root, then it won’t run user’s scripts. I am running out of ideas.
Though if it runs as root, then it won’t run user’s scripts. I am running out of ideas.
Same problem, Is there any way to fix it ?
@eprev Looks like monitoring /Library/Preferences/SystemConfiguration
did work as the script is (aggressively, I might add - this isn't a bad thing) picking up on the SSID change and changing location. No evidence that user scripts are being executed as you note.
Instead of a user script you could also base the network changing on this script (been using that for years and it still works): http://hints.macworld.com/article.php?story=2005010613401823
@sylwester- @pbernicchi @Lesen1991 Please update (reboot may be required), managed to fix the issue:
$ launchctl unload $HOME/Library/LaunchAgents/LocationChanger.plist
$ curl -L https://github.com/eprev/locationchanger/raw/master/locationchanger.sh | bash
Fantastic script! Worked like a charm on Catalina.
On the Big Sur beta I get the following error:
Load failed: 5: Input/output error