PDA

Bekijk de volledige versie : ip-up.custom and ip-down.custom scripts?



Khurram
23-09-2010, 07:54
Is there anyway to run a custom script in addition to the built-in one when ppp connects/disconnects? I know that ip-up and ip-down are symlinked to /sbin/rc which is a binary file. I would like to run the custom script after the call to /sbin/rc.

ABATAPA
23-09-2010, 08:18
Is there anyway to run a custom script in addition to the built-in one when ppp connects/disconnects? I know that ip-up and ip-down are symlinked to /sbin/rc which is a binary file. I would like to run the custom script after the call to /sbin/rc.
The solution is elementary.

Replace symlinks /tmp/ppp/ip-down and /tmp/ppp/ip-up with your script. In the script, before or after, depending on the requirements, call the old script with parameters:

/tmp/ppp/ip-up $@
or
/tmp/ppp/ip-down $@

Khurram
23-09-2010, 08:32
/tmp/ppp/ip-up $@
or
/tmp/ppp/ip-down $@
If you mean "/sbin/rc $@" (since originally the /tmp/ppp/ip-up script is linked to /sbin/rc), then I have already tried it and it does not work. I think the /sbin/rc script does things like setting up masquerading, updating /tmp/resolve.conf, updating time, etc. None of these are executed if called like "/sbin/rc $@".