Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'NETGEAR Gateway RT314' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
NETGEAR Gateway RT314
Authored by: ces3001 on Jun 12, '03 02:04:16PM

For some reason, the HTML code in the post was taken literally, even though I used the ampersand notations. (Problem: They get switched to real HTML angle brackets when I het the Preview button). Hmmm.

Well, Here goes again.

This is the modified routerip.pl script mentioned in the original post.

 #!/usr/bin/perl
 #
 # Retrieve the current ip address from the NetGear router...
 # based on LinkSys router code by
 # Jerry LeVan (jerry.levan@eku.edu)
 # Mac OS X 10.1.4
 # May 12,2002
 # Modified by Cecil Esquivel (ces(@)alum.mit.edu) June 11, 2003
 # for NETGEAR RT314
 #
 my ($pattern,$thePage,$theAddress,$wan,$ip,$theip);
 
 #define the pattern we are looking for...
 $wan = 'WAN Port :</B></FONT></TD>[^:]*';
 $ip = 'IP Address :[ ]*<B>\n';
 $theip = '(\d+\.\d+\.\d+\.\d+)[ ]*</B>';
 $pattern = $wan.$ip.$theip;
 
 # Fetch the page
 $thePage = `curl -s -u admin:*youradminpassword* http://192.168.0.1/mtenSysStatus.html`  ;
 # Look for the current IP embedded in the Status Page
 if ($thePage =~ m|$pattern|)
 {
  $theAddress = $1;
  print $theAddress,"\n";
  # here you could mail the address ...
 }
 else
 {
  print "Problem getting address...\n";
 }  


[ Reply to This | # ]