[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.17 and 1.20

version 1.17, 2007/01/31 18:44:27 version 1.20, 2007/01/31 22:19:07
Line 1 
Line 1 
 #!/usr/bin/perl  #!/usr/bin/perl
 # $RedRiver: update_trango.pl,v 1.16 2007/01/08 16:49:44 mike Exp $  # $RedRiver: update_trango.pl,v 1.19 2007/01/31 22:14:26 andrew Exp $
 ########################################################################  ########################################################################
 # update_trango.pl *** Updates trango foxes with a new firmware  # update_trango.pl *** Updates trango foxes with a new firmware
 #  #
Line 57 
Line 57 
   }    }
   
   if ($t->firmware_version eq $conf->{'ver'}) {    if ($t->firmware_version eq $conf->{'ver'}) {
     $l->sp("Already up to date with firmware version '$t->firmware_version'");      $l->sp("Already up to date with firmware version '" . $t->firmware_version . "'");
     $t->close;      $t->close;
     next;      next;
   }    }
Line 83 
Line 83 
   my $t    = shift;    my $t    = shift;
   my $file = shift;    my $file = shift;
   
     my $fw_type = 'Firmware';
     if (uc($conf->{'firmware_type'}) eq 'FPGA') {
       $fw_type = 'FPGA';
     }
   
   my $ver = $t->ver;    my $ver = $t->ver;
   $l->p("Current version '$ver->{'Firmware Version'}'");    $l->p("Current version '" . $ver->{$fw_type . ' Version'} . "'");
   
   if (    if (
     $ver->{'Firmware Version'}  eq $conf->{'ver'} &&      $ver->{$fw_type . ' Version'}  eq $conf->{'ver'} &&
     $ver->{'Firmware Checksum'} eq $conf->{'cksum'}      $ver->{$fw_type . ' Checksum'} eq $conf->{'cksum'}
   ) {    ) {
     $l->sp("Already updated!");      $l->sp("Already updated!");
     return 1;      return 1;
Line 126 
Line 131 
     if ( $results->{'File Checksum'} ne $conf->{'file_cksum'}) {      if ( $results->{'File Checksum'} ne $conf->{'file_cksum'}) {
       $l->sp(        $l->sp(
         "File checksum '" . $results->{'File Checksum'} .          "File checksum '" . $results->{'File Checksum'} .
         "does not match config file '" . $conf->{'file_cksum'} . "'!"          " does not match config file '" . $conf->{'file_cksum'} . "'!"
       );        );
       next;        next;
     }      }
Line 150 
Line 155 
     }      }
     $l->p("File name  matches . . . ");      $l->p("File name  matches . . . ");
   
     $l->p("Updating flash (new checksum '$conf->{'cksum'}')");      my $image_type = 'mainimage';
       if ($fw_type eq 'FPGA') {
         $image_type = 'fpgaimage';
       }
       $l->p("Updating $image_type (new checksum '$conf->{'cksum'}')");
     unless ($results = $t->updateflash(      unless ($results = $t->updateflash(
       args => 'mainimage ' . $ver->{'Firmware Checksum'} .        args => $image_type . ' ' . $ver->{$fw_type . ' Checksum'} .
               ' '          . $conf->{'cksum'},                ' '          . $conf->{'cksum'},
       Timeout => 90,        Timeout => 90,
     ) ) {      ) ) {

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.20

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