=================================================================== RCS file: /cvs/trango/Net-Telnet-Trango/scripts/update_trango.pl,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- trango/Net-Telnet-Trango/scripts/update_trango.pl 2007/01/31 22:19:07 1.20 +++ trango/Net-Telnet-Trango/scripts/update_trango.pl 2007/02/01 17:08:44 1.21 @@ -1,5 +1,5 @@ #!/usr/bin/perl -# $RedRiver: update_trango.pl,v 1.19 2007/01/31 22:14:26 andrew Exp $ +# $RedRiver: update_trango.pl,v 1.20 2007/01/31 22:19:07 mike Exp $ ######################################################################## # update_trango.pl *** Updates trango foxes with a new firmware # @@ -50,7 +50,13 @@ next; } - if ($t->host_type ne $conf->{'type'}) { + my $host_type = $t->host_type; + + if (lc($conf->{'firmware_type'}) eq 'fpga') { + $host_type =~ s/\s.*$//; + } + + if ($host_type ne $conf->{'type'}) { $l->sp("Wrong type of unit ('" . $t->host_type . "' should be '$conf->{'type'}')"); $t->close; next; @@ -96,7 +102,7 @@ $ver->{$fw_type . ' Checksum'} eq $conf->{'cksum'} ) { $l->sp("Already updated!"); - return 1; + return 0; } my $try = 0; @@ -116,8 +122,10 @@ # use tftp to push the file up my $tftp = Net::TFTP->new($t->Host, Mode => 'octet'); - $tftp->put($file, $file) - or die "Error uploading: " . $tftp->error; + unless ($tftp->put($file, $file)) { + print "Error uploading: " . $tftp->error; + next; + } # waitfor some sort of output # make sure it says 'Success.' otherwise error