Execute Script on Connection established using Network Manager Dispatcher

If you want a script to be executed each time a Network connection is established there is a easy way to do so with Linux distributions which use the Network Manager (like Fedora, Suse, Ubuntu etc.). You simply have to copy the script to the directory /etc/NetworkManager/dispatcher.d and change the permissions to 755. (It is crucial to use 755, otherwise the script will be ignored.

chmod 755 /etc/NetworkManager/dispatcher.d/10-my-scirpt

The scipts in this directory are executed by the order of their name eg. 10-my-script will be executed before 20-my-script.

One Comment

  1. Posted May 23, 2013 at 6:25 am | Permalink | Reply

    Thanks it was very useful for me 😉

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: