[H-GEN] Dynamic IPs

Paul Gearon gearon at computer.org
Sat Mar 4 17:27:44 EST 2000


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

Hilton Travis wrote:
> 
> [ Humbug *General* list - semi-serious discussions about Humbug and ]
> [ Unix-related topics.  Please observe the list's charter.          ]
> 
> Hi All,
> 
> 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.

-- 
Regards,
Paul

Paul Gearon
gearon at computer.org

Catapultam habeo. Nisi pecuniam omnem mihi dabis, ad caput tuum saxum
immane mittam.
(Translation from latin: "I have a catapult. Give me all the money,
or I will fling an enormous rock at your head.")

--
* 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