eprev / eprev.org

That’s my spot.
https://eprev.org
5 stars 1 forks source link

Not switching back to "Automatic" network location #23

Closed mathengines closed 6 years ago

mathengines commented 6 years ago

I have defined a new network location on a laptop for my kid to work at school. At home, the "Automatic" location is used. The Wi-Fi networks are joined automatically after login. At school, the network location switches automatically to the user defined location as expected. But at home, it doesn't switch back to the "Automatic" location until the Wi-Fi connection is turned off/on. The log file reflects this behaviour.

Notes:

eprev commented 6 years ago

Hey, @mathengines, thank you so much for a such detailed report! It makes a total sense to add RunAtLoad option, I'll modify the script after I come from the vacation or feel free to send a pull request.

mathengines commented 6 years ago

I think the problem could be that at login the Wi-Fi network at home is joined before the launch agent is loaded and the event is missed. At school, hundred of students may join the school Wi-Fi within a short time and the process finishes probably after the loading of the launch agent which has more chance to detect the event. The RunAtLoad option secures the detection of network change at login.

eprev commented 6 years ago

Pushed https://github.com/eprev/locationchanger/commit/267bcc49271f09623f58d2e12dc1cbe9421003b0

Thanks!