=================================================================== RCS file: /cvs/trango/Net-Telnet-Trango/scripts/update_trango.pl,v retrieving revision 1.16 retrieving revision 1.18 diff -u -r1.16 -r1.18 --- trango/Net-Telnet-Trango/scripts/update_trango.pl 2007/01/08 16:49:44 1.16 +++ trango/Net-Telnet-Trango/scripts/update_trango.pl 2007/01/31 19:01:12 1.18 @@ -1,5 +1,5 @@ #!/usr/bin/perl -# $RedRiver: update_trango.pl,v 1.15 2005/12/30 20:26:41 andrew Exp $ +# $RedRiver: update_trango.pl,v 1.17 2007/01/31 18:44:27 mike Exp $ ######################################################################## # update_trango.pl *** Updates trango foxes with a new firmware # @@ -9,7 +9,6 @@ use warnings; use Net::TFTP; -use YAML; use lib '.'; use Net::Telnet::Trango; @@ -45,7 +44,6 @@ Timeout => 5, Errmode => 'return', ) or die "Couldn't make new connection: $!"; - $l->p("Connecting to $fox"); unless ( $t->open($fox) ) { $l->sp("Error connecting: $!"); @@ -53,13 +51,13 @@ } if ($t->host_type ne $conf->{'type'}) { - $l->sp("Wrong type of unit ('$t->host_type' should be '$conf->{'type'}')"); + $l->sp("Wrong type of unit ('" . $t->host_type . "' should be '$conf->{'type'}')"); $t->close; next; } 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; next; } @@ -69,24 +67,13 @@ $l->p("Sending commands"); ## Send commands - #print Dump $t->login_banner; - #print Dump $t->sysinfo; - #print Dump $t->last_lines; - #print Dump $t->ver(); - #print Dump $t->tftpd(); - #print Dump $t->enable_tftpd(); - #print Dump [ "Exit", $t->exit ]; - #print Dump $t->tftpd(); - #print Dump $t->disable_tftpd(); - #print Dump $t->tftpd(); - print Dump $t->sulog(args => 5); - #if ( upload($t, $conf->{'file_name'}) ) { - # $l->p("Rebooting"); - # $t->reboot; - #} else { + if ( upload($t, $conf->{'file_name'}) ) { + $l->p("Rebooting"); + $t->reboot; + } else { $l->p("Exiting"); $t->exit; - #} + } $l->sp(""); } @@ -177,7 +164,7 @@ defined $results->{'Checksum'} && $results->{'Checksum'} eq $conf->{'cksum'} ) { - $l->sp("Saved checksum does not match config file!"); + $l->sp("Saved checksum " . $results->{'Checksum'} . " does not match config file " . $conf->{'cksum'} . "!"); next; } $l->p("Uploaded checksum ($results->{'Checksum'}) " .