[BACK]Return to update_trango.pl CVS log [TXT][DIR] Up to [local] / trango / Net-Telnet-Trango / scripts

Diff for /trango/Net-Telnet-Trango/scripts/update_trango.pl between version 1.12 and 1.13

version 1.12, 2005/12/29 18:41:17 version 1.13, 2005/12/30 01:02:41
Line 1 
Line 1 
 #!/usr/bin/perl  #!/usr/bin/perl
 # $RedRiver: update_trango.pl,v 1.11 2005/12/21 02:03:30 andrew Exp $  # $RedRiver: update_trango.pl,v 1.12 2005/12/29 18:41:17 andrew Exp $
 ########################################################################  ########################################################################
 # update_trango.pl *** Updates trango foxes with a new firmware  # update_trango.pl *** Updates trango foxes with a new firmware
 #  #
Line 44 
Line 44 
   my $t = new Net::Telnet::Trango ({    my $t = new Net::Telnet::Trango ({
     Host    => $fox,      Host    => $fox,
     Timeout => 5,      Timeout => 5,
   });      Errmode => 'return',
     }) or die "Couldn't make new connection: $!";
   
   $l->p("Connecting to $fox");    $l->p("Connecting to $fox");
   my ($type, $version) = $t->connect();    unless ($t->open) {
       $l->sp("Error connecting: $!");
   unless (defined $type && defined $version) {  
     $l->sp("Error connecting!");  
     next;      next;
   }    }
   
   if ($type ne $conf->{'type'}) {    if ($t->host_type ne $conf->{'type'}) {
     $l->sp("Wrong type of unit ('$type' should be '$conf->{'type'}')");      $l->sp("Wrong type of unit ('$t->host_type' should be '$conf->{'type'}')");
     $t->close;      $t->close;
     next;      next;
   }    }
   
   if ($version eq $conf->{'ver'}) {    if ($t->firmware_version eq $conf->{'ver'}) {
     $l->sp("Already up to date with firmware version '$version'");      $l->sp("Already up to date with firmware version '$t->firmware_version'");
     $t->close;      $t->close;
     next;      next;
   }    }
Line 71 
Line 70 
   
   $l->p("Sending commands");    $l->p("Sending commands");
   ## Send commands    ## Send commands
   #print Dump $t->ver();    print Dump $t->login_banner;
   #print Dump $t->tftpd();    print Dump $t->sysinfo;
   if ( upload($t, $conf->{'file_name'}) ) {    print Dump $t->last_lines;
     $l->p("Rebooting");    print Dump $t->ver();
     $t->reboot;    print Dump $t->tftpd();
   } else {    print Dump $t->enable_tftpd();
     print Dump [ "Exit", $t->exit ];
     print Dump $t->tftpd();
     print Dump $t->disable_tftpd();
     print Dump $t->tftpd();
     #if ( upload($t, $conf->{'file_name'}) ) {
     #   $l->p("Rebooting");
     #  $t->reboot;
     #} else {
     $l->p("Exiting");      $l->p("Exiting");
     $t->exit;      $t->exit;
   }    #}
       
   $t->close;  
   $l->sp("");    $l->sp("");
 }  }
   
Line 159 
Line 165 
   
     $l->p("Updating flash (new checksum '$conf->{'cksum'}')");      $l->p("Updating flash (new checksum '$conf->{'cksum'}')");
     unless ($results = $t->updateflash(      unless ($results = $t->updateflash(
       $ver->{'Firmware Checksum'}, $conf->{'cksum'}        args => 'mainimage ' . $ver->{'Firmware Checksum'} .
                 ' '          . $conf->{'cksum'},
         Timeout => 90,
     ) ) {      ) ) {
       $l->sp("Couldn't update flash: $!");        $l->sp("Couldn't update flash: $!");
       next;        next;

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>