locationchanger
locationchanger copied to clipboard
Change the location when not connected to any wifi (just wired)
It would be very great if the location can be change automatically when no wifi network is connected. In my case, I am connected to my wifi network at home, then on my iPhone in the train, but at the office, I don't use any wifi. I am connected by ethernet. So I need to change the location to not use my own home dns.
Hi Thierry,
Unfortunately, OS X doesn't update com.apple.airport.preferences.plist when AirPort goes off, it doesn't seem possible to detect it by observing changes in that file. I like the feature, if you're up to implementing it, feel welcome.
Perhaps it could watch for preferences.plist along with com.apple.airport.preferences.plist.
I don't know. I am not a OsX developper. Just Java and Angular........ I am just a user.
There is also probably other way to know if connected to a wire network. Like looking at the interfaces.
You can probably do something like:
networksetup -listnetworkserviceorder | grep 'Hardware Port'
Then use the interface name in the result with ifconfig to look at its status.....