getting IP address of router

Lennart Sorensen lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org
Fri Feb 11 14:51:23 UTC 2005


On Fri, Feb 11, 2005 at 01:35:29AM -0500, jim ruxton wrote:
> Thanks Anton, No this router doesn't support SNMP. It's ok though
> because others have pointed out alternative methods that seem to work.
> Except I'm still having trouble figuring out why the following script
> doesn't work properly for me where it does for other people. If anyone
> has any suggestions why I'm eager to hear them.
> 
> # curl -s -o - http://www.myip.dk | sed  's%.* IP: \(.*\)</title>.*%\1%'
> 
> I'm using:
> 
> GNU sed version 4.0.8
> curl 7.10.6 
> 
> My output should be :
> 65.229.223.184
> 
> but its:
> 
> 
> 65.229.223.184???</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>

Here the output is: 67.69.26.43

And that's it.

Could you try doing: curl -s -o - http://www.myip.dk > myip.log, and
include that output in a message (not sure the list does attachments).
I am wondering if the output of the site varies in some way based on the
ip connecting (that would be weird however).

You could also try this one:
lynx -dump http://www.myip.dk|head -n 4|tail -n 1|sed -e 's% %%g'

Maybe that works better.

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





More information about the Legacy mailing list