I use VPN client to connect to my corporate servers. It creates tun0 interface after starting the client. I've written script which install specific routes point to tun0 interface and rest to use normal wifi connection. So that, only my office related traffic goes via VPN and rest are goes via home internet connection. How do I make the script to run automatically when tun0 interface up/down events ?.
I am not sure about
Inside the script you can determine which interface is interested from the content of the variable
To be sure, add a simple script to
make it executable
then see if the up events are recorded in