Timothy Bolz wrote:

> Bob
> 
> I should have been a little more specific.  I have a perl script which 
> extracts the ip address similar to the one you posted a long time ago.  Back 
> then I wrote a  bash shell script which used your script to write a web page 
> which had my IP address on it.

How about linking to this URL instead?

        http://www.whatismyipaddress.com/


> It was a plain page with the IP.  I now can't find the script so I
> thought I'd write another in Perl.  If I remember right to make the
> html page I did this.

I've attached a script that does basically what you want.  Feel free
to customize it as you see fit.

Notes:

1. I got rid of the Content-type line.  You shouldn't need that in the
   file itself.  If your browser doesn't recognize the file as HTML,
   you can add a <!DOCTYPE> declaration.

2. As you requested, this script writes directly to a file.  If you
   hadn't asked for it that way, though, I would have had the script
   write to standard output, and invoked it from a shell command
   (whether interactive or from the ppp startup script or whatever)
   where the shell redirects output into the right file.  Small matter.

3. If you have an ethernet NIC as well as a dialup connection on this
   box, you'll have to adjust getmyipaddress() a bit to ignore eth0's
   address.

-- 
Bob Miller                              K<bob>
kbobsoft software consulting
http://kbobsoft.com                     [EMAIL PROTECTED]

Attachment: myip.pl
Description: Perl program

Reply via email to