[Q] PPP - ip-up.d

Matthew Hawkins matt at mh.dropbear.id.au
Mon Jun 10 20:13:16 EST 2002

Donovan J. Edye (d.edye at bigfoot.com) wrote:
> I want to take some action only when a particular connection is dialled. I
[--- snip ---]

I wrote a script to bring up an encrypted tunnel to work, the remote end
relied on knowing (er, being told that is) the (dynamically-allocated)
IP address of the current ADSL session.  Wasn't too difficult using the
standard Unix tools (awk, grep, sed, ps) to work out if the connection
was up, and if so what it's IP address was.   The script (written like
all good Debian /etc/init.d scripts) had a stop command also which
naturally added 'kill' into the mix to take the tunnel down.

Remember especially in the case of ps to take advantage of some of the
command-line switches so you don't need to grep out grep processes;
there's nothing more I loathe and abhor than redundancy ;)


More information about the linux mailing list