[ previous ] [ next ] [ threads ]
 From:  Adrian Basescu <adrianeli at gmail dot com>
 To:  m0n0wall at lists dot m0n0 dot ch
 Subject:  How can I run a command after the wan link is up and kill it after the wan link is down?
 Date:  Mon, 18 Apr 2005 09:11:51 -0400
I am trying to find a way to run a command after the wan link is up
and kill it after the link is down.  I have tried changing the file
/etc/inc/interfaces.inc which seems to have the subroutine for taking
up and down the wan link.

I have tried adding my command in a form similar to the command used
in the script to set the default route and configure the interface
inside the function
"function interfaces_wan_configure":


and for killing myexec I have tried adding a command similar to the
ones in the interfaces.inc file, immediately after the similar lines
that kill dhcp client and the PPPoE client:


BUT after all this, my process is not starting and it is not stopped
if it was started when the wan goes up/down.

I have uploaded myexec into my m0n0wall and I have run  it manually.
It runs fine and I can kill it by pid number( kill -9 pidnumber).

What can I do further to automate this action, as my changes to the
script seem to be useless?