SI
SI
discoversearch

We've detected that you're using an ad content blocking browser plug-in or feature. Ads provide a critical source of revenue to the continued operation of Silicon Investor.  We ask that you disable ad blocking while on Silicon Investor in the best interests of our community.  If you are not using an ad blocker but are still receiving this message, make sure your browser's tracking protection is set to the 'standard' level.
Pastimes : Linux OS.: Technical questions

 Public ReplyPrvt ReplyMark as Last ReadFilePrevious 10Next 10PreviousNext  
To: Thomas A Watson who wrote (286)1/29/2002 12:55:15 AM
From: Thomas A Watson  Read Replies (1) of 484
 
Extracting the current ISP assigned IP address from a Linksys BEFSR41 V.2 Etherfast Cable/DSL Router.

The Linksys is setup and monitor using a browser. But a login with just a password and no username is required by the linksys before access to even the read only status page.

With the lynx text browser of linux I use lynx -dump 192.168.1.1 page and extract the IP address. But lynx does not have a way of passing only a password.

I looked into how I could use netscape and found with netscape --help
-remote <remote-command> to execute a command in an already-running Netscape process. For more info, see
home.netscape.com
From the x-remote page I cam up with this command sequence.

rm test_file.txt ; netscape -remote 'openURL(http://192.168.1.1/Status.htm)' ; netscape -remote 'saveAs(test_file.txt ,text)' ; grep IP test_file.txt | tail -1 | awk '{print $3}'

The rm removes file as a query about overwriting comes up otherwise.
netscape -remote 'openURL(http://192.168.1.1/Status.htm)' open the page.
netscape -remote 'saveAs(test_file.txt ,text)' save the page
grep IP test_file.txt extract lines with IP
tail -1 filter the last line with IP
awk '{print $3}' print the third item of the line that is the IP address.

tom watson tosiwmee
Report TOU ViolationShare This Post
 Public ReplyPrvt ReplyMark as Last ReadFilePrevious 10Next 10PreviousNext