=================================================================== RCS file: /cvs/trango/Net-Telnet-Trango/scripts/update_trango.pl,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- trango/Net-Telnet-Trango/scripts/update_trango.pl 2007/02/07 22:07:35 1.33 +++ trango/Net-Telnet-Trango/scripts/update_trango.pl 2007/02/07 23:24:39 1.34 @@ -1,5 +1,5 @@ #!/usr/bin/perl -# $RedRiver: update_trango.pl,v 1.32 2007/02/07 19:25:05 andrew Exp $ +# $RedRiver: update_trango.pl,v 1.33 2007/02/07 22:07:35 andrew Exp $ ######################################################################## # update_trango.pl *** Updates trango hosts with a new firmware # @@ -164,9 +164,12 @@ $host->{retry}--; } else { - $l->sp("Failed"); + $l->sp("Failed! - Bye $host->{name}"); + $l->e("Error updating $firmware_type on $host->{name}" . + "(try $host->{tries})"); $t->bye; - next; + # don't try any other firmware, don't want to reboot + last; } } @@ -362,6 +365,7 @@ #use YAML; use constant LOG_PRINT => 128; use constant LOG_SAVE => 64; +use constant LOG_ERR => 1; DESTROY { my $self = shift; @@ -401,6 +405,12 @@ return $self->mylog( $m, LOG_SAVE | LOG_PRINT ); } +sub e { + my $self = shift; + my $m = shift; + return $self->mylog( $m, LOG_ERR ); +} + sub mylog { my $self = shift; @@ -436,6 +446,11 @@ print $MYLOG ( scalar gmtime ), "\t", $thing, "\n" or die "Couldn't print to MYLOG: $!"; flock( $MYLOG, LOCK_UN ); + } + + if ( $which & LOG_ERR ) { + # XXX Could tie in here to handle some sort of notifications. + print STDERR $thing, "\n"; } }