Ubuntu – the best way to launch a process when the Internet connection goes up/down

networking

What is the best way to automatically launch a process when the Internet connection goes up/down?

Best Answer

The old-school way is to put a script in /etc/network/if-up.d and if-down.d. I'm not sure if that still works with NetworkManager or not. There should be scripts in there that you can copy to get started.