Go Back   Wireless and Wifi Forums > News > Newsgroups > alt.internet.wireless
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
  #31 (permalink)  
Old 11-23-2007, 09:54 PM
Sherman Pendley
Guest
 
Posts: n/a
Default Re: Script to disconnect Linksys WRT54G wireless router on Windows

Wilson <davewilson69@sbcglobal.net> writes:

> On Fri, 23 Nov 2007 10:47:50 -0500, Sherman Pendley wrote:
>> When someone who admits to not having any Perl knowledge, and to not being a
>> programmer at all, claims to know what Perl is capable of, I have serious
>> doubts about that claim. Someone who's at that level simply doesn't have the
>> experience or background to reasonably assess Perl's capabilities.

>
> Hi Sherman,
>
> I understand your argument, however, one (or all) of us is missing the main
> point (maybe I didn't make it well enough so I'll try again).


You claimed that Perl can't log into an https server and simulate a button
click. My point is that this claim is false; that kind of "web scraping" is
a very common use of Perl.

> I don't know if it will push this project forward to continue to "discuss"
> without actually progressing - but - my main point was there is no evidence
> in the literature that it has ever been done with a Linksys WRT54G router.
>
> ... no evidence in the literature that perl works for this purpose ...


Absence of proof is not proof of absence.

> At least nobody has ever posted a solution for logging into https Linksys
> WRT54G (other than me and my script didn't work) - so my main point is that
> there is absolutely no evidence that perl can do these two steps:
> a) Log into the Linksys WRT54G as https
> b) Press a button


In a generic sense, there are literally hundreds of examples of Perl doing what
you claim it can't do - just google for "WWW::Mechanize" or "perl web scraping"
to see them. There is absolutely no question that Perl is capable of logging
into an https web server and performing the moral equivalent of a button click.

> Either that, or just run my posted script and let us know if you get the
> SAME errors I posted.


I have a different model Linksys. I could adapt the script you posted to work
with my own router, and post that as "proof," but that wouldn't be useful for
you. It wouldn't work for *your* router, because mine is quite old and it's
quite likely that its admin interface is arranged differently.

The odds of your finding someone who owns the exact same model router, *and*
is capable of writing a script like this, are very small. You'll need to start
with a script that was originally written for another make and model router,
and adapt it to fit the admin interface for your own router.

I think your problem is one of unrealistic expectations. There is no standard
for browser-based router interfaces, and you can't reasonably expect a script
in *any* language that was written for a different router to work unchanged
with yours.

sherm--

--
WV News, Blogging, and Discussion: http://wv-www.com
Cocoa programming in Perl: http://camelbones.sourceforge.net

Reply With Quote
  #32 (permalink)  
Old 11-23-2007, 10:24 PM
Ben Morrow
Guest
 
Posts: n/a
Default Re: Script to disconnect Linksys WRT54G wireless router on Windows


Quoth Wilson <davewilson69@sbcglobal.net>:
> On Fri, 23 Nov 2007 19:27:26 +0000, Ben Morrow wrote:
> >> At least nobody has ever posted a solution for logging into https Linksys
> >> WRT54G (other than me and my script didn't work)

> > About the only case where it's non-trivial to fake a browser's request
> > with Perl is when the page includes JavaScript that changes what is
> > about to be submitted in a non-trivial way.

>
> I turned off javascript and java in my browser and guess what? I
> could log into my Linksys WRT54G router but I could NOT access any of the
> buttons. The web page was "garbled" (for lack of a better description)
> without Javascript and/or Java.
>
> Hmmmm... does this mean that Perl can "impersonate" java somehow?


Do you understand how http works? The client makes a request, and the
server returns a response. There is no way the server can tell if the
client is IE with javascript or something else that just happens to make
the same requests in the same order. For the last time: *you need to
find out what requests your browser is actually making*. Then you can
begin working out how to reproduce them from Perl, which will almost
certainly be straightforward.

Ben


Reply With Quote
  #33 (permalink)  
Old 11-23-2007, 11:26 PM
DTC
Guest
 
Posts: n/a
Default Re: Script to disconnect Linksys WRT54G wireless router on Windows

Wilson wrote:
> Advice for the next guy: Be forewarned; you can't press a button on a
> Linksys WRT65G router using Perl. Some other approach might work; but not
> Perl.


Since I have no idea what the Linksys WRT65G is, I can't say your
statement is total bull excrement.

We used to use a Perl script to reset the Linksys WAP54G by remote control.


Reply With Quote
  #34 (permalink)  
Old 11-23-2007, 11:29 PM
DTC
Guest
 
Posts: n/a
Default Re: Script to disconnect Linksys WRT54G wireless router on Windows

DTC wrote:
> Wilson wrote:
>> Advice for the next guy: Be forewarned; you can't press a button on a
>> Linksys WRT65G router using Perl. Some other approach might work; but not
>> Perl.

>
> Since I have no idea what the Linksys WRT65G is, I can't say your
> statement is total bull excrement.
>
> We used to use a Perl script to reset the Linksys WAP54G by remote control.


I was just reminded by my partner we used it on the Linksys WRT54G four
years ago.


Reply With Quote
  #35 (permalink)  
Old 11-23-2007, 11:36 PM
Mark McIntyre
Guest
 
Posts: n/a
Default Re: Script to disconnect Linksys WRT54G wireless router on Windows

Wilson wrote:
> On Thu, 22 Nov 2007 08:27:27 -0500, Sherman Pendley wrote:
>> Perl - what makes you think that something is impossible simply because *you*
>> can't figure it out?

>
> I'd like to agree with you Sherman, but, it's pretty simple to prove my
> point. Nobody else has figured it out either.


FWIW this isn't a proof. It merely shows that /to date/ nobody smart
enough or interested enough has looked into it.

For three hundred years Fermat's Last Theorem stood unproven. That
doesn't mean it was impossible to prove. Someday someone will prove the
Riemann Hypothesis too.

Reply With Quote
  #36 (permalink)  
Old 11-24-2007, 05:25 AM
l v
Guest
 
Posts: n/a
Default Re: Script to disconnect Linksys WRT54G wireless router on Windows

Wilson wrote:
> On Fri, 23 Nov 2007 04:23:59 -0000, tramp wrote:
>> You're in way over your head

> agreed. That's why I'm asking here.
>
>> nobody here owes it to you to

> agreed.
> I'm asking anyone with a Linksys WRT54G router to just run the script once
> and report back if they see the same issue.
>
>> your biggest difficulty is lack of Perl experience

> agreed.
> However an experienced programmer wrote the original script & it failed to
> reboot the router.
>
>> People will be more likely to help if they can be sure this is
>> purely a Perl-programming problem.

> It is and is not a perl-programming problem. If Perl can't do it (which I
> seriously suspect), then it's not a perl programming problem, I agree. We
> can't really ask perl to do what it just can not do.
>
>> If you haven't done so already, get the original reboot script working

> The original perl script never worked for anyone, not even the original
> programmer. He did his best. So did I. Both failed.
>
>> That will verify that Perl and its libraries are properly installed

> I agree - we need to verify this somehow. What would be a good way to
> verify that an https web page can be accessed via a perl script and a
> button on that https web page pressed?
>
>> nothing in Windows networking (or maybe a local firewall?)

> I've turned off the software firewall for the testing
>
>> that the router is reachable by Perl,

> Another good one. What is the basic test of that?
>
>> that the username/password pair is working

> Yet another good one. How would we test this?
>
>> that Perl can successfully issue commands to the router.

> Ah. This is the big kehuna. Can perl issue commands to a router or not?
>
>> Then if your script doesn't work, you know that the problem lies
>> somewhere in your modifications to the reboot script.

> The reboot script never worked even for the original programmer. He said it
> was the best he could do in perl.


My WRT54G (v8.00.2) is not configured the same as yours so I can not
test the script for you. Nor does my device connect directly to the
internet, rather it sits behind my DSL modem. No connect/disconnect
buttons.

FWIW, by using Win32::Internet on a WinXPsp2 using Perl 5.6.1, I can
"click" the 'DHCP Clients Table' button located under Status | Local
Network.

Perhaps you should try cURL within a batch file and forgo the
programming, but you will still need to know how call a web site outside
of a web browser -- same as if you were using Perl.

--

Len

Reply With Quote
  #37 (permalink)  
Old 11-24-2007, 06:25 AM
Wilson
Guest
 
Posts: n/a
Default Re: Script to disconnect Linksys WRT54G wireless router on Windows

On Fri, 23 Nov 2007 17:29:57 -0600, DTC wrote:
> I was just reminded by my partner we used it on the Linksys WRT54G four
> years ago.


Can you post that Perl script? I'd love to try it out on my Linksys WRT54G
wireless router!

Reply With Quote
  #38 (permalink)  
Old 11-24-2007, 06:28 AM
Wilson
Guest
 
Posts: n/a
Default Re: Script to disconnect Linksys WRT54G wireless router on Windows

On Fri, 23 Nov 2007 23:25:23 -0600, l v wrote:
> My WRT54G (v8.00.2) is not configured the same as yours so I can not
> test the script for you. Nor does my device connect directly to the
> internet, rather it sits behind my DSL modem. No connect/disconnect
> buttons.


Hi lv,
My WRT54G also sits "behind" a DSL modem.

If you navigate to the Linksys WRT54G "Status -> Router" page, do you see
the "Disconnect" or "Connect" button?

This connects or disconnects from the DSL modem (depending on whether you
are already connected or disconnected).

Reply With Quote
  #39 (permalink)  
Old 11-24-2007, 06:29 AM
Wilson
Guest
 
Posts: n/a
Default Re: Script to disconnect Linksys WRT54G wireless router on Windows

On Fri, 23 Nov 2007 23:36:51 +0000, Mark McIntyre wrote:
> FWIW this isn't a proof. It merely shows that /to date/ nobody smart
> enough or interested enough has looked into it.


OK. Agreed.

Reply With Quote
  #40 (permalink)  
Old 11-24-2007, 06:31 AM
Wilson
Guest
 
Posts: n/a
Default Re: Script to disconnect Linksys WRT54G wireless router on Windows

On Fri, 23 Nov 2007 16:54:36 -0500, Sherman Pendley wrote:
> In a generic sense, there are literally hundreds of examples of Perl doing what
> you claim it can't do - just google for "WWW::Mechanize" or "perl web scraping"
> to see them. There is absolutely no question that Perl is capable of logging
> into an https web server and performing the moral equivalent of a button click.


Even web pages which seem to require "javascript" in order to view the
buttons?

BTW, I tested the router - it does not need java; just javascript.

Reply With Quote
  #41 (permalink)  
Old 11-24-2007, 06:32 AM
Wilson
Guest
 
Posts: n/a
Default Re: Script to disconnect Linksys WRT54G wireless router on Windows

On Fri, 23 Nov 2007 22:24:21 +0000, Ben Morrow wrote:

> *you need to find out what requests your browser is actually making*.


Hi Ben,
I'm working on it.
Thanks
Wilson

Reply With Quote
  #42 (permalink)  
Old 11-24-2007, 06:43 AM
Wilson
Guest
 
Posts: n/a
Default Re: Script to disconnect Linksys WRT54G wireless router on Windows

On Fri, 23 Nov 2007 22:24:21 +0000, Ben Morrow wrote:
> *you need to find out what requests your browser is actually making*.
> Then you can begin working out how to reproduce them from Perl


I do not know if this helps but this is the web page at the Linksys WRT54G
router page "Status -> Router" https://192.168.0.1/StaRouter.htm


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- <HTML><HEAD><TITLE>Router Status</TITLE> -->
<HTML><HEAD><TITLE></TITLE>
<META http-equiv=expires content=0>
<META http-equiv=cache-control content=no-cache>
<META http-equiv=pragma content=no-cache>

<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">

<LINK href="style.css" type=text/css rel=stylesheet>
<STYLE fprolloverstyle>A:hover {
COLOR: #00ffff
}
..small A:hover {
COLOR: #00ffff
}
</STYLE>

<SCRIPT src="common.js"></SCRIPT>
<script language="javascript" type="text/javascript"
src="capstatus.js"></script>

<script language="javascript" type="text/javascript"
src="share.js"></script>
<script language="javascript" type="text/javascript"
src="help.js"></script>
<SCRIPT language=JavaScript>
var refresh_time = "";
var flag=0;
function DHCPAction(F,I)
{
F.action.value=I;
F.submit();
}

function ConnStats(obj)
{
var F=document.status;
if(flag == 1){
F.action.value="Connect";
}
else{
F.action.value="Disconnect";
}
F.submit();
}

function GetWAN()
{
var F=document.status;
var wan_num=F.wan_pro.value;
if(wan_num==2){
if
(((F.conn_stats.value=="-1")&&(status2!="Connecting"))||((F.conn_stats.valu e=="201")&&(status2!="Connecting"))||((F.conn_stat s.value=="202")&&(status2!="Connecting"))||((F.con n_stats.value=="203")&&(status2!="Connecting"))||( (F.conn_stats.value=="200")&&(status2!="Connecting "))){
flag = 1;
F.butConn.value=stacontent.connect;
}
else{
F.butConn.value=stacontent.disconnect;
flag = 0;
}
}
else if((wan_num==3) || (wan_num==4) || (wan_num==5)){
if((F.conn_stats.value=="-1")&&(status2!="Connecting")){
flag = 1;
F.butConn.value=stacontent.connect;
}
else{
flag = 0;
F.butConn.value=stacontent.disconnect;
}
}
}
function ShowAlert(M)
{
var str = "";
var mode = "";
/* */
var wan_ip = "69.110.22.230";

if(document.status.wan_pro.value == 2)
mode = "PPPoE";
else if(document.status.wan_pro.value == 3)
mode = "PPTP";
else if(document.status.wan_pro.value == 4)
mode = "L2TP";
else if(document.status.wan_pro.value == 5)
mode = "HBS";
else
mode = "PPPoE";

if(M == "AUTH_FAIL" || M == "PAP_AUTH_FAIL" || M == "CHAP_AUTH_FAIL")
str = mode + stacontent.authfail;
else if(M == "IP_FAIL" || (M == "TIMEOUT" && wan_ip == "0.0.0.0"))
str = stacontent.notgetip + mode + stacontent.wansrv +
stacontent.wansrvlastwords;
else if(M == "LCP_FAIL")
str = mode + stacontent.lcpfail;
else if(M == "TCP_FAIL" || (M == "TIMEOUT" && wan_ip != "0.0.0.0"
&& (document.status.wan_pro.value == 5)))
str = stacontent.notcpconn + mode + stacontent.wansrv;
else
str = stacontent.notconn + mode + stacontent.wansrv;

alert(str);

Refresh();
}
var value=0;
function Refresh()
{
if(refresh_time == "") refresh_time = 60000;
if (value>=1)
{
window.location.replace("StaRouter.htm");
}
value++;
timerID=setTimeout("Refresh()",refresh_time);
}
function ViewDHCP()
{
dhcp_win =
self.open('DHCPTable.htm','inLogTable','alwaysRais ed,resizable,scrollbars,width=720,height=600');
dhcp_win.focus();
}
function init()
{
var F=document.status;
var wan_num=F.wan_pro.value;
if((wan_num>=2) && (wan_num <= 5)){
document.status.butConn.value=stacontent.connect;
}
if(wan_num==0){
document.status.dhcprelease.value=share.dhcpreleas e;
document.status.dhcprenew.value=share.dhcprenew;
}
document.title=share.router;
document.status.refresh.value=sbutton.refresh;
GetWAN();

Refresh();
/**/
}

</SCRIPT>

<META content="MSHTML 6.00.2800.1226" name=GENERATOR></HEAD>
<BODY onload=init()>
<DIV align=center>
<FORM name=status action="rstatus.tri" method=post>
<input type="hidden" name="action">
<TABLE cellSpacing=0 cellPadding=0 width=809 border=0>
<TBODY>
<TR>

<TD width=95><IMG height=57 src="UILinksys.gif" width=165
border=0></TD>
<TD vAlign=bottom align=right width=714 bgColor=#6666cc><FONT
style="FONT-SIZE: 7pt" color=#ffffff><FONT
face=Arial><script>Capture(share.firmwarever)</script>:&nbsp;v1.02.0
&nbsp;&nbsp;&nbsp;</FONT></FONT></TD></TR>
<TR>
<TD width=808 bgColor=#6666cc colSpan=2><IMG height=11
src="UI_10.gif" width=809 border=0></TD></TR></TBODY></TABLE>
<TABLE height=77 cellSpacing=0 cellPadding=0 width=809 bgColor=black
border=0>
<TBODY>
<TR>
<TD
style="FONT-WEIGHT: normal; FONT-SIZE: 10pt; COLOR: black; FONT-STYLE:
normal; FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-VARIANT: normal"
borderColor=#000000 align=middle width=163 height=49>

<H3 style="MARGIN-TOP: 1px; MARGIN-BOTTOM: 1px"><FONT
style="FONT-SIZE: 15pt" face=Arial
color=#ffffff><script>Capture(bmenu.statu)</script></FONT></H3></TD>
<TD
style="FONT-WEIGHT: normal; FONT-SIZE: 10pt; COLOR: black; FONT-STYLE:
normal; FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-VARIANT: normal"
vAlign=center borderColor=#000000 width=646 bgColor=#000000 height=49>
<TABLE
style="FONT-WEIGHT: normal; FONT-SIZE: 10pt; COLOR: black;
FONT-STYLE: normal; FONT-FAMILY: Arial, Helvetica, sans-serif;
BORDER-COLLAPSE: collapse; FONT-VARIANT: normal"
height=33 cellSpacing=0 cellPadding=0 bgColor=#6666cc border=0>
<TBODY>
<TR>
<TD style="FONT-WEIGHT: bolder; FONT-SIZE: 10pt" align=right
bgColor=#6666cc height=33><FONT
color=#ffffff><script>Capture(share.productname)</script>&nbsp;&nbsp;</FONT></TD>
<TD borderColor=#000000 borderColorLight=#000000 align=middle
width=109 bgColor=#000000 borderColorDark=#000000 height=12
rowSpan=2><FONT color=#ffffff><SPAN
style="FONT-SIZE: 8pt"><B>WRT54G</B></SPAN></FONT></TD></TR>

<TR>
<TD
style="FONT-WEIGHT: normal; FONT-SIZE: 1pt; COLOR: black;
FONT-STYLE: normal; FONT-FAMILY: Arial, Helvetica, sans-serif;
FONT-VARIANT: normal"
width=537 bgColor=#000000 height=1>&nbsp;</TD></TR>
<TR>
<TD width=646 bgColor=#000000 colSpan=2 height=32>
<TABLE id=AutoNumber1
style="FONT-WEIGHT: normal; FONT-SIZE: 10pt; COLOR: black;
FONT-STYLE: normal; FONT-FAMILY: Arial, Helvetica, sans-serif;
BORDER-COLLAPSE: collapse; FONT-VARIANT: normal"
height=6 cellSpacing=0 cellPadding=0 width=637 border=0>
<TBODY>
<TR
style="BORDER-RIGHT: medium none; BORDER-TOP: medium none;
FONT-WEIGHT: normal; FONT-SIZE: 1pt; BORDER-LEFT: medium none; COLOR:
black; BORDER-BOTTOM: medium none; FONT-STYLE: normal; FONT-FAMILY: Arial,
Helvetica, sans-serif; FONT-VARIANT: normal"
align=middle bgColor=#6666cc>
<TD width=83 height=1><IMG height=10
src="UI_06.gif" width=83 border=0></TD>
<TD width=73 height=1><IMG height=10
src="UI_06.gif" width=83 border=0></TD>

<TD width=113 height=1><IMG height=10
src="UI_06.gif" width=83 border=0></TD>
<TD width=103 height=1><IMG height=10
src="UI_06.gif" width=103 border=0></TD>
<TD width=85 height=1><IMG height=10
src="UI_06.gif" width=100 border=0></TD>
<TD width=115 height=1><IMG height=10
src="UI_06.gif" width=115 border=0></TD>
<TD width=74 height=1><IMG height=10
src="UI_07.gif" width=79 border=0></TD></TR>
<TR>
<TD align=middle bgColor=#000000 height=20><FONT
style="FONT-WEIGHT: 700" color=#ffffff><A
style="TEXT-DECORATION: none"

href="basic.htm"><script>Capture(bmenu.setup)</script></A></FONT></TD>
<TD align=middle bgColor=#000000 height=20><FONT
style="FONT-WEIGHT: 700" color=#ffffff><A
style="TEXT-DECORATION: none"

href="Wireless.htm"><script>Capture(bmenu.wireless )</script></A></FONT></TD>

<TD align=middle bgColor=#000000 height=20><FONT
style="FONT-WEIGHT: 700" color=#ffffff><A
style="TEXT-DECORATION: none"

href="Firewall.htm"><script>Capture(bmenu.security )</script></A></FONT></TD>
<TD align=middle bgColor=#000000 height=20><FONT
style="FONT-WEIGHT: 700" color=#ffffff><A
style="TEXT-DECORATION: none"

href="Filters.htm"><script>Capture(bmenu.accrestri ction)</script></A></FONT></TD>
<TD align=middle bgColor=#000000 height=20>
<P style="MARGIN-BOTTOM: 4px"><FONT style="FONT-WEIGHT:
700"
color=#ffffff><A style="TEXT-DECORATION: none"

href="Forward.htm"><script>Capture(bmenu.applicati ons)</script><BR>&amp;

<script>Capture(bmenu.gaming)</script></A>&nbsp;&nbsp;&nbsp;&nbsp;</FONT></P></TD>
<TD align=middle bgColor=#000000 height=20>
<P style="MARGIN-BOTTOM: 4px"><FONT style="FONT-WEIGHT:
700"
color=#ffffff><A style="TEXT-DECORATION: none"

href="Manage.htm"><script>Capture(bmenu.admin)</script></A>&nbsp;&nbsp;&nbsp;&nbsp;</FONT></P></TD>

<TD align=middle bgColor=#6666cc height=20>
<P style="MARGIN-BOTTOM: 4px"><FONT style="FONT-WEIGHT:
700"
color=#ffffff><A style="TEXT-DECORATION: none"

href="StaRouter.htm"><script>Capture(bmenu.statu)</script></A>&nbsp;&nbsp;&nbsp;&nbsp;</FONT></P></TD></TR>
<TR>
<TD width=643 bgColor=#6666cc colSpan=7 height=21>
<TABLE borderColor="black" height="21" cellSpacing="0"
cellPadding="0">
<TBODY>
<TR align=left>
<TD width=25></TD>

<TD width=65><FONT style="COLOR:
white"><script>Capture(share.router)</script></FONT></TD>
<TD>
<P class=bar><FONT
color=white><B>|</B></FONT></P></TD>
<TD width=25></TD>
<TD class=small width=100><A

href="StaLan.htm"><script>Capture(share.localnet)</script></A></TD>
<TD>
<P class=bar><FONT
color=white><B>|</B></FONT></P></TD>

<TD width=25></TD>
<TD class=small width=100><SPAN>&nbsp;</SPAN><A

href="StaWlan.htm"><script>Capture(bmenu.wireless) </script></A></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<TABLE height=5 cellSpacing=0 cellPadding=0 width=806 bgColor=black
border=0>
<TBODY>
<TR bgColor=black>
<TD
style="FONT-WEIGHT: normal; FONT-SIZE: 10pt; COLOR: black; FONT-STYLE:
normal; FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-VARIANT: normal"
borderColor=#e7e7e7 width=163 bgColor=#e7e7e7 height=1><IMG height=15
src="UI_03.gif" width=164 border=0></TD>
<TD
style="FONT-WEIGHT: normal; FONT-SIZE: 10pt; COLOR: black; FONT-STYLE:
normal; FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-VARIANT: normal"
width=646 height=1><IMG height=15 src="UI_02.gif" width=645
border=0></TD></TR></TBODY></TABLE>

<INPUT type=hidden value="2" name=wan_pro>
<INPUT type=hidden value="300" name=conn_stats>

<TABLE id=AutoNumber9 style="BORDER-COLLAPSE: collapse" borderColor=#111111
height=23 cellSpacing=0 cellPadding=0 width=809 border=0>
<TBODY>
<TR>
<TD width=633>
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD width=156 bgColor=#000000 height=25>
<P align=right><B><FONT style="FONT-SIZE: 9pt" face=Arial

color=#ffffff><script>Capture(share.routerinfo)</script></B></P></FONT></TD>

<TD width=8 bgColor=#000000 height=25>&nbsp;</TD>
<TD width=14 height=25>&nbsp;</TD>
<TD width=17 height=25>&nbsp;</TD>
<TD width=13 height=25>&nbsp;</TD>
<TD width=101 height=25>&nbsp;</TD>
<TD width=296 height=25>&nbsp;</TD>
<TD width=13 height=25>&nbsp;</TD>
<TD width=15 background=UI_05.gif height=25>&nbsp;</TD></TR>
<TR>

<TD width=156 bgColor=#e7e7e7 height=25>&nbsp;</TD>
<TD width=8 background=UI_04.gif height=25>&nbsp;</TD>
<TD colSpan=3 height=25>&nbsp;</TD>
<TD width=101
height=25><script>Capture(share.firmwarever)</script>:</TD>
<TD><B>v1.02.0, <script>Capture(month.num1)</script>. 16, 2007
</B></TD>
<TD width=13 height=25>&nbsp;</TD>

<TD width=15 background=UI_05.gif height=25>&nbsp;</TD></TR>
<TR>
<TD width=156 bgColor=#e7e7e7 height=25>&nbsp;</TD>
<TD width=8 background=UI_04.gif height=25>&nbsp;</TD>
<TD colSpan=3 height=25>&nbsp;</TD>
<TD width=101
height=25><script>Capture(share.curtime)</script>:</TD>
<TD><B><script>Capture(week.num6)</script>,
<script>Capture(month.num11)</script> 23 2007 22:35:32 </B></TD>

<TD width=13 height=25>&nbsp;</TD>
<TD width=15 background=UI_05.gif height=25>&nbsp;</TD></TR>
<TR>
<TD width=156 bgColor=#e7e7e7 height=25>&nbsp;</TD>
<TD width=8 background=UI_04.gif height=25>&nbsp;</TD>
<TD colSpan=3 height=25>&nbsp;</TD>
<TD width=101
height=25><script>Capture(share.macaddr)</script>:</TD>
<TD><B>B1:B1:A1:A1:32:00</B></TD>

<TD width=13 height=25>&nbsp;</TD>
<TD width=15 background=UI_05.gif height=25>&nbsp;</TD></TR>
<TR>
<TD width=156 bgColor=#e7e7e7 height=25>&nbsp;</TD>
<TD width=8 background=UI_04.gif height=25>&nbsp;</TD>
<TD colSpan=3 height=25>&nbsp;</TD>
<TD width=101
height=25><script>Capture(share.routename)</script>:</TD>
<TD style="word-wrap:break-word;
word-break:break-all"><B><script>Capture("WRT54G")</script></B></TD>

<TD width=13 height=25>&nbsp;</TD>
<TD width=15 background=UI_05.gif height=25>&nbsp;</TD></TR>
<TR>
<TD width=156 bgColor=#e7e7e7 height=25>&nbsp;</TD>
<TD width=8 background=UI_04.gif height=25>&nbsp;</TD>
<TD colSpan=3 height=25>&nbsp;</TD>
<TD width=101
height=25><script>Capture(share.hostname)</script>:</TD>
<TD style="word-wrap:break-word;
word-break:break-all"><B><script>Capture("")</script></B></TD>

<TD width=13 height=25>&nbsp;</TD>
<TD width=15 background=UI_05.gif height=25>&nbsp;</TD></TR>
<TR>
<TD width=156 bgColor=#e7e7e7 height=25>&nbsp;</TD>
<TD width=8 background=UI_04.gif height=25>&nbsp;</TD>
<TD colSpan=3 height=25>&nbsp;</TD>
<TD width=101
height=25><script>Capture(share.domainname)</script>:</TD>
<TD style="word-wrap:break-word;
word-break:break-all"><B><script>Capture("")</script></B></TD>

<TD width=13 height=25>&nbsp;</TD>
<TD width=15 background=UI_05.gif height=25>&nbsp;</TD></TR>
<TR>
<TD width=156 bgColor=#000000 height=25>
<P align=right><B><FONT style="FONT-SIZE: 9pt"
color=#ffffff><SPAN><script>Capture(share.internet )</script></SPAN></FONT></B></P></TD>
<TD width=8 bgColor=#000000 height=25>&nbsp;</TD>
<TD colSpan=6>&nbsp;</TD>
<TD width=15 background=UI_05.gif height=25>&nbsp;</TD></TR>

<TR>
<TD width=156 bgColor=#e7e7e7 height=25>
<P align=right><FONT style="FONT-WEIGHT:
700"><SPAN><script>Capture(share.cfgtype)</script></SPAN></FONT></P></TD>
<TD width=8 background=UI_04.gif height=25>&nbsp;</TD>
<TD colSpan=3 height=25>&nbsp;</TD>
<TD width=101
height=25><SPAN><script>Capture(stacontent.logtype )</script></SPAN><FONT
style="FONT-SIZE: 8pt">:</FONT></TD>
<TD><B>PPPoE</B></TD>

<TD width=13 height=25>&nbsp;</TD>
<TD width=15 background=UI_05.gif height=25>&nbsp;</TD></TR>
<script language="javascript">
if((document.status.wan_pro.value>=2) &&
(document.status.wan_pro.value<=5)){
document.write("<TR>");
document.write("<TD width=156 bgColor=#e7e7e7
height=25>&nbsp;</TD>");
document.write("<TD width=8 background=UI_04.gif
height=25>&nbsp;</TD>");
document.write("<TD colSpan=3 height=25>&nbsp;</TD>");
document.write("<TD><FONT style='FONT-SIZE:
8pt'>"+stacontent.logsta+":</FONT></TD>");
document.write("<TD><FONT style='FONT-SIZE: 8pt'><B>");
var F=document.status;

var status2 = "Connected";
if(status2 == "Connecting") sta2 = stacontent.connecting;
else if(status2 == "Disconnected") sta2 = stacontent.disconn;
else if(status2 == "Connected") sta2 = stacontent.conn;
document.write(sta2);
document.write("&nbsp;&nbsp;");

/*
if( (F.conn_stats.value=="200") || (F.conn_stats.value=="201")||
(F.conn_stats.value=="202")|| (F.conn_stats.value=="203") )
document.write("Connecting");
else if(F.conn_stats.value=="300")
document.write("Connected");
else
document.write("Disconnected");
Disconnected=stacontent.disconn;
Connected=stacontent.conn;
if(document.forms[0].conn_stats.value=="0")
document.write(Disconnected);
else
document.write(Connected);
*/


document.write("<INPUT type=button name=butConn value='Connect'
onClick='ConnStats(this)'>");
document.write("</B></FONT></TD>");
document.write("<TD width=13 height=25>&nbsp;</TD>");
document.write("<TD width=15 background=UI_05.gif
height=25>&nbsp;</TD></TR>");
}
</script>
<TR>
<TD width=156 bgColor=#e7e7e7 height=25>&nbsp;</TD>
<TD width=8 background=UI_04.gif height=25>&nbsp;</TD>
<TD colSpan=3 height=25>&nbsp;</TD>
<TD><FONT style="FONT-SIZE:
8pt"><script>Capture(share.ipaddr)</script>:</FONT></TD>

<TD><FONT style="FONT-SIZE: 8pt"><B>69.110.22.230</B></FONT></TD>
<TD width=13 height=25>&nbsp;</TD>
<TD width=15 background=UI_05.gif height=25>&nbsp;</TD></TR>
<TR>
<TD width=156 bgColor=#e7e7e7 height=25>&nbsp;</TD>
<TD width=8 height=25><IMG height=30 src="UI_04.gif"
width=8 border=0></TD>
<TD bgColor=#ffffff colSpan=3 height=25>&nbsp;</TD>
<TD width=101 bgColor=#ffffff height=25><FONT
style="FONT-SIZE:
8pt"><script>Capture(share.submask)</script>:</FONT></TD>

<TD width=296 bgColor=#ffffff height=25><FONT
style="FONT-SIZE: 8pt"><B>255.255.255.255</B></FONT></TD>
<TD width=13 bgColor=#ffffff height=25>&nbsp;</TD>
<TD width=15 bgColor=#ffffff height=25><IMG height=30
src="UI_05.gif" width=15 border=0></TD></TR>
<TR>
<TD width=156 bgColor=#e7e7e7 height=25>&nbsp;</TD>
<TD width=8 height=25><IMG height=30 src="UI_04.gif"
width=8 border=0></TD>
<TD bgColor=#ffffff colSpan=3 height=25>&nbsp;</TD>
<TD width=101 bgColor=#ffffff height=25><FONT
style="FONT-SIZE:
8pt"><script>Capture(share.defgateway)</script></FONT></TD>

<TD width=296 bgColor=#ffffff height=25><FONT
style="FONT-SIZE: 8pt"><B>151.164.184.81</B></FONT></TD>
<TD width=13 bgColor=#ffffff height=25>&nbsp;</TD>
<TD width=15 bgColor=#ffffff height=25><IMG height=30
src="UI_05.gif" width=15 border=0></TD></TR>
<TR>
<TD width=156 bgColor=#e7e7e7 height=25>&nbsp;</TD>
<TD width=8 background=UI_04.gif height=25>&nbsp;</TD>
<TD colSpan=3 height=25>&nbsp;</TD>
<TD><FONT style="FONT-SIZE:
8pt"><script>Capture(stacontent.dns1)</script>:</FONT></TD>

<TD><FONT style="FONT-SIZE: 8pt"><B>68.94.156.1</B></FONT></TD>
<TD width=13 height=25>&nbsp;</TD>
<TD width=15 background=UI_05.gif height=25>&nbsp;</TD></TR>
<TR>
<TD width=156 bgColor=#e7e7e7 height=25>&nbsp;</TD>
<TD width=8 background=UI_04.gif height=25>&nbsp;</TD>
<TD colSpan=3 height=25>&nbsp;</TD>
<TD height=25><FONT style="FONT-SIZE:
8pt"><script>Capture(stacontent.dns2)</script>:</FONT></TD>

<TD height=25><FONT style="FONT-SIZE:
8pt"><B>68.94.157.1</B></FONT></TD>
<TD width=13 height=25>&nbsp;</TD>
<TD width=15 background=UI_05.gif height=25>&nbsp;</TD></TR>
<TR>
<TD width=156 bgColor=#e7e7e7 height=25>&nbsp;</TD>
<TD width=8 background=UI_04.gif height=25>&nbsp;</TD>
<TD colSpan=3 height=25>&nbsp;</TD>
<TD height=25><FONT style="FONT-SIZE:
8pt"><script>Capture(stacontent.dns3)</script>:</FONT></TD>

<TD height=25><FONT style="FONT-SIZE: 8pt"><B></B></FONT></TD>
<TD width=13 height=25>&nbsp;</TD>
<TD width=15 background=UI_05.gif height=25>&nbsp;</TD></TR>
<TR>
<TD width=156 bgColor=#e7e7e7 height=25>&nbsp;</TD>
<TD width=8 background=UI_04.gif height=25>&nbsp;</TD>
<TD colSpan=3 height=25>&nbsp;</TD>
<TD height=25><FONT style="FONT-SIZE:
8pt"><script>Capture(share.mtu)</script>:</FONT></TD>

<TD height=25><FONT style="FONT-SIZE:
8pt"><B>1492</B></FONT></TD>
<TD width=13 height=25>&nbsp;</TD>
<TD width=15 background=UI_05.gif height=25>&nbsp;</TD></TR>
<TR>
<TD width=156 bgColor=#e7e7e7 height=1>&nbsp;</TD>
<TD width=8 background=UI_04.gif height=1>&nbsp;</TD>
<TD colSpan=6>
<TABLE>

<TBODY>
<TR>
<TD width=16 height=1>&nbsp;</TD>
<TD width=13 height=1>&nbsp;</TD>
<TD width=410 colSpan=3 height=1>
<HR color=#b5b5e6 SIZE=1>
</TD>
<TD width=15 height=1>&nbsp;</TD></TR></TBODY></TABLE></TD>
<TD width=15 background=UI_05.gif height=1>&nbsp;</TD></TR>


<TR>
<TD width=156 bgColor=#e7e7e7 height=25>&nbsp;</TD>
<TD width=8 background=UI_04.gif height=25>&nbsp;</TD>
<TD colSpan=3 height=25>&nbsp;</TD>
<TD height=25><INPUT type=hidden value=en name=layout></TD>
<TD height=25>&nbsp;</TD>
<TD width=13 height=25>&nbsp;</TD>
<TD width=15 background=UI_05.gif height=25>&nbsp;</TD></TR>

<script language=javascript>
if(document.status.layout.value=="de"){
document.write(other.block6);
}
</script>
<script language="javascript">
if(document.status.wan_pro.value==0){
document.write("<TR><TD width=156 bgColor=#e7e7e7
height=25>&nbsp;</TD>");
document.write("<TD width=8 background=UI_04.gif
height=25>&nbsp;</TD>");
document.write("<TD colSpan=3 height=25>&nbsp;</TD>");
document.write("<TD colSpan=2 height=25><INPUT
onclick=DHCPAction(this.form,'release') name='dhcprelease' type=button
value="+share.dhcprelease+">&nbsp;&nbsp;&nbsp;&nbs p;<INPUT
onclick=DHCPAction(this.form,'renew') name='dhcprenew' type=button
value="+share.dhcprenew+">&nbsp;</TD>");
<!-- document.write("<TD colSpan=2 height=25><INPUT
onclick=DHCPAction(this.form,'release') name='dhcprelease' type=button
value='DHCP Release'>&nbsp;&nbsp;&nbsp;&nbsp;<INPUT
onclick=DHCPAction(this.form,'renew') name='dhcprenew' type=button
value='DHCP Renew'>&nbsp;</TD>"); -->
document.write("<TD width=13 height=25>&nbsp;</TD>");
document.write("<TD width=15 background=UI_05.gif
height=25>&nbsp;</TD></TR>");
}
</script>
<TR>
<TD width=156 bgColor=#e7e7e7 height=5>&nbsp;</TD>
<TD width=8 background=UI_04.gif height=5>&nbsp;</TD>
<TD colSpan=6>&nbsp;</TD>
<TD width=15 background=UI_05.gif
height=5>&nbsp;</TD></TR></TBODY></TABLE></TD>
<TD vAlign=top width=176 bgColor=#6666cc>

<TABLE cellSpacing=0 cellPadding=0 width=176 border=0>
<TBODY>
<TR>
<TD width=11 bgColor=#6666cc height=25>&nbsp;</TD>
<TD width=156 bgColor=#6666cc height=25><FONT
color=#ffffff><SPAN><br>
<script>Capture(hstatus.phase23)</script>
<b><a target="_blank"
href="HStatus.htm"><script>Capture(share.more)</script></a></b></span><br><br>
<script>Capture(hstatus.phase24)</script>
<b><A href="HStatus.htm"
target=_blank><script>Capture(share.more)</script></A></b></SPAN></FONT></TD>

<TD width=9 bgColor=#6666cc
height=25>&nbsp;</TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD width=809 colSpan=2>
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD width=156 bgColor=#e7e7e7 height=30>&nbsp;</TD>
<TD width=8 background=UI_04.gif>&nbsp;</TD>
<TD width=131>&nbsp;</TD>

<TD width=323>&nbsp;</TD>
<TD width=15 background=UI_05.gif>&nbsp;</TD>
<TD width=176 bgColor=#6666cc rowSpan=2><IMG height=64
src="UI_Cisco.gif" width=176 border=0></TD></TR>
<TR>
<TD width=156 bgColor=#000000>&nbsp;</TD>
<TD width=8 bgColor=#000000>&nbsp;</TD>
<TD width=131 bgColor=#6666cc>&nbsp;</TD>
<TD width=323 bgColor=#6666cc>
<DIV align=right>

<TABLE style="BORDER-COLLAPSE: collapse" borderColor=#111111
height=19 cellSpacing=0 cellPadding=0 width=33 border=0>
<TBODY>
<TR>
<TD align=middle width=61>
<script language="javascript">
document.write("<INPUT
onclick=window.location.replace('StaRouter.htm') type=button name=refresh
value="+sbutton.refresh+">")
</script>
</TD>
<!-- <INPUT
onclick="window.location.replace('StaRouter.htm')" type=button
name="refresh" value="Refresh"> -->
<TD align=middle width=4
bgColor=#6666cc>&nbsp;</TD></TR></TBODY></TABLE></DIV></TD>
<TD width=15 bgColor=#000000

height=33>&nbsp;</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></FORM></DIV></BODY></HTML>

Reply With Quote
  #43 (permalink)  
Old 11-24-2007, 02:13 PM
Dr.Ruud
Guest
 
Posts: n/a
Default Re: Script to disconnect Linksys WRT54G wireless router on Windows

Wilson schreef:

> If you navigate to the Linksys WRT54G "Status -> Router" page, do you
> see the "Disconnect" or "Connect" button?
>
> This connects or disconnects from the DSL modem (depending on whether
> you are already connected or disconnected).


Most WAN-routers also have a textual interface (like telnet) that is
much easier to handle programmatically, so why go the non-easy way?

--
Affijn, Ruud

"Gewoon is een tijger."


Reply With Quote
  #44 (permalink)  
Old 11-24-2007, 05:14 PM
DTC
Guest
 
Posts: n/a
Default Re: Script to disconnect Linksys WRT54G wireless router on Windows

Wilson wrote:
> On Fri, 23 Nov 2007 17:29:57 -0600, DTC wrote:
>> I was just reminded by my partner we used it on the Linksys WRT54G four
>> years ago.

>
> Can you post that Perl script? I'd love to try it out on my Linksys WRT54G
> wireless router!


I'll see if we have it saved somewhere. We haven't worked with Linksys
units for some time.

Reply With Quote
  #45 (permalink)  
Old 11-24-2007, 05:58 PM
Wilson
Guest
 
Posts: n/a
Default Re: Script to disconnect Linksys WRT54G wireless router on Windows

On Sat, 24 Nov 2007 11:14:22 -0600, DTC wrote:

>> Can you post that Perl script?

>
> I'll see if we have it saved somewhere.


Thanks.

Reply With Quote
  #46 (permalink)  
Old 11-24-2007, 06:01 PM
Wilson
Guest
 
Posts: n/a
Default Re: Script to disconnect Linksys WRT54G wireless router on Windows

On Sat, 24 Nov 2007 15:13:48 +0100, Dr.Ruud wrote:

> Most WAN-routers also have a textual interface (like telnet) that is
> much easier to handle programmatically, so why go the non-easy way?


I am almost to the point of giving up on Perl so I think I'll follow Ben's
prior suggestions which seem to be more powerful than Perl.

I think, based on my experience only, that for Perl to interpret Javascript
is something nobody has ever posted, so, who am I, an avowed beginner and
non programmer, to get it working first.

I have just one or two more experiments to try. I don't have a programmers'
mind, but I do see a few more things I can tweak and try as every time I
try something, I see something else that "might" be the culprit or the
solution.

I find that part fun even though I don't know how to program. I sure hope
to post a solution for the world to benefit - but first I have to get it
working.

Thanks for the advice.

Reply With Quote
  #47 (permalink)  
Old 11-24-2007, 06:06 PM
Wilson
Guest
 
Posts: n/a
Default Re: Script to disconnect Linksys WRT54G wireless router on Windows

On Fri, 23 Nov 2007 02:40:00 +0000, Ben Morrow wrote:

> Have you tried using http://www.research.att.com/sw/tools/wsp/? If the
> web page served by the router is being too clever (and they *always*
> seem to be) then this may help.


Hi Ben,
You have always been the one useful voice of reason. The rest were voices
of reason, but not useful (like the ones who lambasted my lack of
programming experience or those who claimed it could be done w/o any
evidence). They were right, of course, but they weren't helpful to getting
the task accomplished.

For your insight, I appreciate. I will try just a couple more experiments
with the Perl approach as I hate to lose. I'm not a programmer, nor do I
have a programmer's mentality, but, I just hate it when something should
work but it doesn't for some unknown reason. That irks me and irked me in
my dreams all night, sadly to say.

Anyway, I'll be re-reading your posts and attempting the closest thing to
what looks like it will work to perform the following:

a) Open an https web page on the Linksys WRT54G router
b) Log in with a username of null and a password of "letmein"
c) Press a javascripted button on that web page called "Disconnect"

Thanks!

Reply With Quote
  #48 (permalink)  
Old 11-24-2007, 06:13 PM
Wilson
Guest
 
Posts: n/a
Default Re: Script to disconnect Linksys WRT54G wireless router on Windows

On Thu, 22 Nov 2007 08:27:27 -0500, Sherman Pendley wrote:
> What nonsense. You said yourself that you're not a programmer and don't know
> Perl - what makes you think that something is impossible simply because *you*
> can't figure it out?


Hi Sherman,
After calming down, I must apologize for saying "Perl can't do it", as, as
you noted, I am not a programmer, nor do I have a programmer's mentality
.... so who am I to say whether it can be done or not. In my frustration, I
guess I was "blaming" perl but I did not mean to malign that language.

It's just that I really hate it when I have to do anything manual and,
despite the fact I'm not a programmer-type person, I always try to cut down
on the number of button clicks I do, even if it's only three or five clicks
when I do it a lot. I find that makes me much more efficient even if there
is a lot of up-front work to get the job done.

So, I _will_ automate the task of disconnecting and reconnecting from the
ISP - I just don't know how yet. I have just a few more things to try
(although I said that days ago) and I'll get the damn thing working.

Thanks and sorry for not being of the mind and body like you guys are!
I admire you and what you can do with code!
Wilson

Reply With Quote
  #49 (permalink)  
Old 11-24-2007, 06:55 PM
Sherman Pendley
Guest
 
Posts: n/a
Default Re: Script to disconnect Linksys WRT54G wireless router on Windows

Wilson <davewilson69@sbcglobal.net> writes:

> On Fri, 23 Nov 2007 16:54:36 -0500, Sherman Pendley wrote:
>> In a generic sense, there are literally hundreds of examples of Perl doing what
>> you claim it can't do - just google for "WWW::Mechanize" or "perl web scraping"
>> to see them. There is absolutely no question that Perl is capable of logging
>> into an https web server and performing the moral equivalent of a button click.

>
> Even web pages which seem to require "javascript" in order to view the
> buttons?


No, WWW::Mechanize doesn't run the JavaScript. But to be fair, you didn't mention
the JavaScript requirement - all you said was that Perl couldn't fetch an https
page and click a button. :-)

One approach you might try is viewing the source of the HTML page in your browser,
figuring out what the JS does in a browser, and then writing the same behavior into
your Perl script.

> BTW, I tested the router - it does not need java; just javascript.


JS is annoying enough. Makes me happy I haven't upgraded my ancient BEFSR41. :-)

sherm--

--
WV News, Blogging, and Discussion: http://wv-www.com
Cocoa programming in Perl: http://camelbones.sourceforge.net

Reply With Quote
  #50 (permalink)  
Old 11-24-2007, 06:56 PM
Bit Twister
Guest
 
Posts: n/a
Default Re: Script to disconnect Linksys WRT54G wireless router on Windows

On Sat, 24 Nov 2007 18:13:08 GMT, Wilson wrote:

> After calming down, I must apologize for saying "Perl can't do it", as, as
> you noted, I am not a programmer, nor do I have a programmer's mentality
> ... so who am I to say whether it can be done or not. In my frustration, I
> guess I was "blaming" perl but I did not mean to malign that language.


Hey, you can learn to work the computer, or let the computer work you.


> It's just that I really hate it when I have to do anything manual and,
> despite the fact I'm not a programmer-type person, I always try to cut down
> on the number of button clicks I do, even if it's only three or five clicks
> when I do it a lot. I find that makes me much more efficient even if there
> is a lot of up-front work to get the job done.


Yep, computer is nice for automation and repetitive tasks.

> So, I _will_ automate the task of disconnecting and reconnecting from the
> ISP - I just don't know how yet. I have just a few more things to try
> (although I said that days ago) and I'll get the damn thing working.


I do not do windows, I run Mandriva Linux.
I plugged Mechanize into my Software Management application search
box, and 7t'h selection click gave me

perl-WWW-Mechanize-Shell - WWW::Mechanize::Shell - An interactive
shell for WWW::Mechanize

This module implements a www-like shell above WWW::Mechanize and also
has the capability to output crude Perl code that recreates the
recorded session. Its main use is as an interactive starting point for
automating a session through WWW::Mechanize.


Reply With Quote
  #51 (permalink)  
Old 11-24-2007, 07:04 PM
l v
Guest
 
Posts: n/a
Default Re: Script to disconnect Linksys WRT54G wireless router on Windows

Wilson wrote:
> On Fri, 23 Nov 2007 23:25:23 -0600, l v wrote:
>> My WRT54G (v8.00.2) is not configured the same as yours so I can not
>> test the script for you. Nor does my device connect directly to the
>> internet, rather it sits behind my DSL modem. No connect/disconnect
>> buttons.

>
> Hi lv,
> My WRT54G also sits "behind" a DSL modem.
>
> If you navigate to the Linksys WRT54G "Status -> Router" page, do you see
> the "Disconnect" or "Connect" button?
>
> This connects or disconnects from the DSL modem (depending on whether you
> are already connected or disconnected).


Wilson

As I stated, my WRT54G is configured differently than yours -- no
"disconnect" or "connect" button under "Status -> Router".

While c.l.p.m is not the proper newsgroup for this, I see from your HTML
posting, that you have your WRT54G set to use PPPoE. Mine is not.

Let me guess at your problem. Your DSL modem changes public IP address
on occasion. When it does you need to re-connect your WRT54G to get the
new pubic IP address as well. Am I correct?

I set my WRT54G to use a Static IP (Setup -> Basic Setup). My DSL
modem's IP address is 192.168.1.1

I use the following settings for the WRT54G:
Internet IP Address: . . . 192.168.1.10
Subnet Mask: . . . 255.255.255.0
Gateway: . . . <my DSL ip>
Static DNS 1: . . . my ISPs 1st DNS server
Static DNS 2: . . . my ISPs 2nd DNS server
Static DNS 3: . . . 0.0.0.0

Local IP Address: . . . 192.168.2.1
Subnet Mask: . . . 255.255.255.0

I then have no need to disconnect and re-connect the WRT54G when my
DSL's pubic ip address changes.

--

Len

Reply With Quote
  #52 (permalink)  
Old 11-24-2007, 07:06 PM
l v
Guest
 
Posts: n/a
Default Re: Script to disconnect Linksys WRT54G wireless router on Windows

Dr.Ruud wrote:
> Wilson schreef:
>
>> If you navigate to the Linksys WRT54G "Status -> Router" page, do you
>> see the "Disconnect" or "Connect" button?
>>
>> This connects or disconnects from the DSL modem (depending on whether
>> you are already connected or disconnected).

>
> Most WAN-routers also have a textual interface (like telnet) that is
> much easier to handle programmatically, so why go the non-easy way?
>


I port scanned my WRT54G when I first got it. Unlike my DSL modem, it
does not respond to telnet nor ssh. I am guessing the OP's wireless
device is the same.

--

Len

Reply With Quote
  #53 (permalink)  
Old 11-24-2007, 08:36 PM
Ben Morrow
Guest
 
Posts: n/a
Default Re: Script to disconnect Linksys WRT54G wireless router on Windows


Quoth Wilson <davewilson69@sbcglobal.net>:
> On Sat, 24 Nov 2007 15:13:48 +0100, Dr.Ruud wrote:
>
> > Most WAN-routers also have a textual interface (like telnet) that is
> > much easier to handle programmatically, so why go the non-easy way?

>
> I am almost to the point of giving up on Perl so I think I'll follow Ben's
> prior suggestions which seem to be more powerful than Perl.


Err, no; you misunderstood me. The tool I pointed you at (WSP) helps
find out what's actually going on between the browser and the router, so
you can then emulate that in Perl (or anything else, for that matter).
If you were feeling macho you could just run tcpdump and work from
there... :)

Ben


Reply With Quote
  #54 (permalink)  
Old 11-25-2007, 08:48 AM
Peter J. Holzer
Guest
 
Posts: n/a
Default Re: Script to disconnect Linksys WRT54G wireless router on Windows

["Followup-To:" header set to comp.lang.perl.misc.]
On 2007-11-24 06:31, Wilson <davewilson69@sbcglobal.net> wrote:
> On Fri, 23 Nov 2007 16:54:36 -0500, Sherman Pendley wrote:
>> In a generic sense, there are literally hundreds of examples of Perl doing what
>> you claim it can't do - just google for "WWW::Mechanize" or "perl web scraping"
>> to see them. There is absolutely no question that Perl is capable of logging
>> into an https web server and performing the moral equivalent of a button click.

>
> Even web pages which seem to require "javascript" in order to view the
> buttons?


In the general case, no: You need a JavaScript interpreter for that.

In most realistic cases, yes: The JavaScript code on the page is always
the same, so you just need to find out what it does and reimplement it
in Perl.

hp


--
_ | Peter J. Holzer | It took a genius to create [TeX],
|_|_) | Sysadmin WSR | and it takes a genius to maintain it.
| | | hjp@hjp.at | That's not engineering, that's art.
__/ | http://www.hjp.at/ | -- David Kastrup in comp.text.tex

Reply With Quote
  #55 (permalink)  
Old 11-25-2007, 09:04 AM
Peter J. Holzer
Guest
 
Posts: n/a
Default Re: Script to disconnect Linksys WRT54G wireless router on Windows

["Followup-To:" header set to comp.lang.perl.misc.]
On 2007-11-24 18:56, Bit Twister <BitTwister@mouse-potato.com> wrote:
> On Sat, 24 Nov 2007 18:13:08 GMT, Wilson wrote:
>> It's just that I really hate it when I have to do anything manual and,
>> despite the fact I'm not a programmer-type person, I always try to cut down
>> on the number of button clicks I do, even if it's only three or five clicks
>> when I do it a lot. I find that makes me much more efficient even if there
>> is a lot of up-front work to get the job done.


So Wilson does have a programmer's mind after all.

>> So, I _will_ automate the task of disconnecting and reconnecting from the
>> ISP - I just don't know how yet. I have just a few more things to try
>> (although I said that days ago) and I'll get the damn thing working.

>
> I do not do windows, I run Mandriva Linux.


I didn't realize Wilson is using Windows. If he does he should be able
to use WWW::Mechanize::IE, which lets him use IE's JavaScript
interpreter.

hp

--
_ | Peter J. Holzer | It took a genius to create [TeX],
|_|_) | Sysadmin WSR | and it takes a genius to maintain it.
| | | hjp@hjp.at | That's not engineering, that's art.
__/ | http://www.hjp.at/ | -- David Kastrup in comp.text.tex

Reply With Quote
  #56 (permalink)  
Old 11-25-2007, 09:23 AM
Peter J. Holzer
Guest
 
Posts: n/a
Default Re: Script to disconnect Linksys WRT54G wireless router on Windows

["Followup-To:" header set to comp.lang.perl.misc.]
On 2007-11-24 18:06, Wilson <davewilson69@sbcglobal.net> wrote:
> You have always been the one useful voice of reason. The rest were voices
> of reason, but not useful (like the ones who lambasted my lack of
> programming experience or those who claimed it could be done w/o any
> evidence).


The proof is rather simple.

1) Perl is a turing-complete programming language which provides the
means to communicate over TCP. Therefore any task which can be
described by an algorithm and which only requires communication over
TCP can be implemented in Perl.

2) The task at hand can be done by a human using a standard web browser.

3) The part done by the browser can of course be implemented by a
program since a browser is a program.

4) So the part done by the human remains: Can this be described by an
algorithm? Yes: It requires only a series of simple, precicely
defined steps.

Therefore the whole task can be implemented in Perl.

Of course that proof is not very useful. Writing a whole web-browser in
Perl just to automate such a simple task would be a bit over the top.
But it shows that it can be done in principle, and once you know one way
to do it you can search for simpler ways.

hp


--
_ | Peter J. Holzer | It took a genius to create [TeX],
|_|_) | Sysadmin WSR | and it takes a genius to maintain it.
| | | hjp@hjp.at | That's not engineering, that's art.
__/ | http://www.hjp.at/ | -- David Kastrup in comp.text.tex