That script does not login to your router -- it creates a LWP object, sets some options, prints something and ends
If you make a successful http request, that is enough indication that you've logged in
So the answer is make a request :)
#!/usr/bin/perl -- use strict; use warnings; use WWW::Mechanize 1.73; my $browser = WWW::Mechanize->new( autocheck => 1 ); $browser -> agent("RouterBot/1.1 "); $browser -> credentials('192.168.1.1','TEL','admin' => 'pass'); $browser -> timeout(10); $browser->show_progress( 1 ); $browser->get('http://192.168.1.1'); if( $browser->success ){ die " we logged in game over"; }
See WWW::Mechanize::Examples as WWW::Mechanize is a much easier to use version of LWP
More tips learn about the internet,Web Programming: For Beginners, to get an overall picture of how the internet works, how tcp/ip, sockets, html, ajax, all fit together.
In reply to Re: Perl LWP Router login
by Anonymous Monk
in thread Perl LWP Router login
by xubu83
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |