|
|
NETGEAR Gateway RT314
I've got a NETGEAR Gateway Rt314 router (Firmware V3.20(CA.1) | 10/27/2000). This script needs to be modified as follows:
#!/usr/bin/perl
#
# retrieve the current ip address from the NetGear router...
# based on
# 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 :[^:]*';
$ip = 'IP Address :[ ]*\n';
$theip = '(\d+\.\d+\.\d+\.\d+)[ ]*';
$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";
}
NETGEAR Gateway RT314
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";
}
|
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.06 seconds |
|