/[cwmp]/google/tcli.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /google/tcli.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3 - (show annotations)
Sat May 19 15:45:05 2007 UTC (17 years ago) by dpavlin
File MIME type: text/plain
File size: 727 byte(s)
simplify and focus :-)
1 #!/usr/bin/perl -w
2
3 use strict;
4 use Expect;
5 use Net::Telnet;
6
7 my $modem = '192.168.1.254';
8 my @commands = (
9 ':system config led=flash',
10 ':system config led=red',
11 ':system config led=off',
12 'exit',
13 );
14
15 my $debug = 0;
16
17 my $telnet = new Net::Telnet( $modem ) or die "Cannot telnet to $modem: $!\n";
18 my $exp = Expect->exp_init($telnet);
19 $exp->debug( $debug );
20
21 my ( $username, $password ) = ('Administrator','');
22 my $timeout = 10;
23
24 my $spawn_ok;
25 $exp->expect($timeout, 'Username : ');
26 $exp->send("$username\r\n");
27 $exp->expect($timeout, 'Password :');
28 $exp->send("$password\r\n");
29 $exp->expect($timeout, '=>');
30
31 foreach my $cmd ( @commands ) {
32 warn "sending >> $cmd\n";
33 $exp->send( "$cmd\r\n" );
34 $exp->expect($timeout, '=>');
35 }
36

Properties

Name Value
svn:executable

  ViewVC Help
Powered by ViewVC 1.1.26