dyndns and pump

Matt Graham danceswithcrows@usa.net
10 Dec 2001 16:57:06 EST


"Melson, Paul" <PMelson@sequoianet.com> wrote:
> Is anybody using pump's scripting capabilities in conjunction w/ a
> dyndns.org client (i.e. ipcheck.py) to leverage event-based
> scripting?
 
(Using "leverage" as a verb is considered to be Marketing-speak.
Cthulhu knows the MBA-wannabees at U of M Business School were addicted
to doing that.)
 
What do you really want to do here?  The dyndns client just takes care
of updating the dyndns registry when it notices your IP has changed.  If
it's written in Python, it's certainly user-extensible, and probably has
hooks to invoke an external command when it notices your IP has changed,
if you'd rather do it that way.
 
> If so, could I see your /etc/pump.conf ?  The man page is vague and I
> have been unable to find any decent how-to info on pump scripts.
 
It looks like you put the following line in /etc/pump.conf :
 
script /usr/local/sbin/mypumpscript.pl
 
And:
 
#!/usr/bin/perl
# put in /usr/local/sbin/mypumpscript.pl
if(#$ARGV == 2){
   print "Interface going down -- Bye!\n";
   exit 0;
   }
($arg1,$arg2,$arg3)=@ARGV;
if($arg1 ~=/renew/ ) {
   print "DHCP renewal, interface = $arg2 , new IP = $arg3\n";
   }
elsif($arg1 ~=/lease/ ){
   print "Found lease, interace = $arg2 , IP = $arg3\n";
   }
else { print "This shouldn't happen, arg1 = $arg1.\n"; }

This being Perl, there are a Huge Number of things you can do here.  You
can also write the script in bash, Python, or a compiled language if you
want to.  Hope this helps...

-- 
Matt G / Dances With Crows
There is no Darkness in Eternity/But only Light too dim for us to see
"I backed up my brain to tape, but tar says the tape contains no data...."