PDA

View Full Version : [SOLVED] Run a program when network connection is established



gagan_mishra
January 5th, 2010, 08:51 AM
I want a program (shell script) to be executed as soon as my DHCP connection is established successfully.

Is there any way I can do this ?

Thanks
Gagan

prshah
January 5th, 2010, 10:59 AM
I want a program (shell script) to be executed as soon as my DHCP connection is established successfully.
Is there any way I can do this ?

Maybe you can take a look at the /sbin/dhclient-script file ?

gagan_mishra
January 6th, 2010, 10:26 AM
Hi,

I got the folder where I need to put the script.

For dhcp its /etc/dhcp3/dhcp-exit-hooks.d/
and for direct connection, to run the script as soon as network is up, the folder is (dont remember exactly ): /etc/network/if-up.d/

Thanks
GBM