[H-GEN] Dynamic IPs

Hilton Travis QuarkComputers at email.com
Sat Mar 4 18:09:57 EST 2000


[ Humbug *General* list - semi-serious discussions about Humbug and ]
[ Unix-related topics.  Please observe the list's charter.          ]

Hi Paul,

> > Does anyone know of any software that will allow posting of
> > your dynamically assigned IP address somewhere (and somehow)
> > so that a web page link can go to the page, regardless of
> > its current IP address?
> >
> > I have a couple of files on my home box I'd like to have access
> > to, but if my ppp dies during the day and auto-redials, I don't
> > know the new IP address.  A link on a page somewhere that
> > automatically gets redirected to the right IP address would be
> > worth its weight in chocolate.
>
> Posting to a web page is not difficult, but depends heavily on how
> you access your web pages.  Personally, I just use email to tell me
> of an IP change.  This has the advantage of telling me as soon as
> my machine redials.
>
> I use a perl script which is a little like this:
>
> #!/usr/bin/perl -w
>
> $emailaddr = "emailname\@email.domain";
>
> @iplist = grep { !/ppp/ } `ifconfig | grep -A 1 ppp`;
> $iplist[0] =~ /addr\:(\S+)/;
>
> open(MAIL, "|sendmail -n $emailaddr");
> print MAIL "Subject: IP address\n$1\n.\n";
> close(MAIL);
>
> Of course, it's a dirty hack, but it works fine.  Assuming you use RH
> just call it from /etc/ppp/ip-up.local.  Sorry, I don't remember the
> file to call it from in Debian.

Thanks for this.  I'm using RedHat on the box in question anyway.  Debian is
waiting in the wings for an install on another box, by the way.

This would do the trick of having me be informed of the IP change, but then
I'd have to manually update the web page in question anyway.  I'd really
like a way to have the web page updated automatically, or have the web page
point to a place that redirects to the correct IP address - saves the
occasional time I forget to update the web page!  I do have a head like a
sieve.

This script will come in quite handy, however.

Regards,
Hilton


--
* This is list (humbug) general handled by majordomo at lists.humbug.org.au .
* Postings to this list are only accepted from subscribed addresses of
* lists 'general' or 'general-post'.



More information about the General mailing list