/[cwmp]/google/trunk/scripts/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

Diff of /google/trunk/scripts/tcli.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 180 by dpavlin, Fri Oct 26 18:12:10 2007 UTC revision 181 by dpavlin, Tue Oct 30 14:45:17 2007 UTC
# Line 5  use Expect; Line 5  use Expect;
5  use Net::Telnet;  use Net::Telnet;
6  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
7    
8    die "usage: $0 [modem] commands\n" unless @ARGV;
9    
10  my $modem = '10.0.0.138';  my $modem = '10.0.0.138';
11  $modem = shift @ARGV if $#ARGV > 1;  $modem = shift @ARGV if $#ARGV >= 1;
12    
13  my @commands = (  my @commands = (
14  ':system config led=flash',  ':system config led=flash',
15  );  );
16    
 warn "ARGV = ",dump( $ARGV );  
   
17  sub ask {  sub ask {
18          my ( $prompt, $default ) = @_;          my ( $prompt, $default ) = @_;
19          warn "## ask $prompt [default]";          warn "## ask $prompt [default]";
# Line 38  push @commands, ':system config led=off' Line 38  push @commands, ':system config led=off'
38    
39  my $debug = 0;  my $debug = 0;
40    
41    warn "## connecting to $modem\n";
42    
43  my $telnet = new Net::Telnet( $modem ) or die "Cannot telnet to $modem: $!\n";  my $telnet = new Net::Telnet( $modem ) or die "Cannot telnet to $modem: $!\n";
44  my $exp = Expect->exp_init($telnet);  my $exp = Expect->exp_init($telnet);
45  $exp->debug( $debug );  $exp->debug( $debug );

Legend:
Removed from v.180  
changed lines
  Added in v.181

  ViewVC Help
Powered by ViewVC 1.1.26