I want to setup my computer to run certain commands when I join or leave certain networks (ie: Start up Synergy when at work; Start up ssh when on the lan at home so I can sync, etc...).
I found iwevent which outputs events to the wireless interface that I can watch. However I can't find an equivalent to watch when eth0 is connected or disconnected.
I tried ip monitor
but there's so much data outputted I can't make use of it sanely.
Is there any command I can use to monitor state changes to eth0? An API available to Python works too.