getting IP address of router

jim ruxton cinetron-uEvt2TsIf2EsA/PxXw9srA at public.gmane.org
Thu Feb 10 01:46:01 UTC 2005


Thanks Lennart,
I tried this:

# curl -s -o - http://www.myip.dk|tail -1|sed -e 's%.* IP:
\(.*\)</title>.*%\1%'

and for some reason where I should be left with just the IP address some
of the rest of the page appears. I can't figure out why. Any idea why
I'm not left with just the IP number?? The text before and directly
after the IP number is stripped away but some of the file remains. Here
is the output I get:

66.229.220.69�</font><br>       <input type="text" name="ip"><br>      
<input type="submit"
value="Konverter"></form></center><p> <center><p><form
method="post" action="/CMyip.dll?DoReverseFormConvert2"
name="form1"><font size="2" face="Verdana">Skriv hostname'et du vil have
IP'en p�</font><br>   <input type="text" name="hostname"><br> <input
type="submit"
value="Konverter"></form></center><p> <center><p><form
method="post" action="/CMyip.dll?DoDecFormConvert" name="form1"><font
size="2" face="Verdana">Skriv IP'en du vil have lavet om til decimal
form:</font><br>    <input type="text" name="ip"><br>  <input
type="submit"
value="Konverter"></form><br><br><br></center></body><!--   I Love you
Eva B. Einarsdttir :)--></html>
snip


Jim
> On Wed, Feb 09, 2005 at 02:50:45PM -0500, jim ruxton wrote:
> > Hi Lennart,
> > I'll have to see if I can find dog. Doesn't seem to be in the Fedora 1
> > apt repository. I tried replacing dog with curl in your script but I
> > guess it's not so easy. Here's what I got..
> 
> curl certainly behaves differently, but probably could be made to work
> given the right options.
> 
> Some other methods that behave like dog http://www.myip.dk
> 
> wget -q -O - http://www.myip.dk
> curl -s -o - http://www.myip.dk
> lynx -source http://www.myip.dk
> 
> etc...
> 
> Lennart Sorensen
> --
> The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
> TLUG requests: Linux topics, No HTML, wrap text below 80 columns
> How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml
> 

--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list