=================================================================== RCS file: /cvs/trango/Net-Telnet-Trango/scripts/update_trango.pl,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- trango/Net-Telnet-Trango/scripts/update_trango.pl 2005/11/16 21:39:51 1.5 +++ trango/Net-Telnet-Trango/scripts/update_trango.pl 2005/11/17 00:40:06 1.6 @@ -1,5 +1,5 @@ #!/usr/bin/perl -# $RedRiver: update_trango.pl,v 1.4 2005/11/16 21:13:39 andrew Exp $ +# $RedRiver: update_trango.pl,v 1.5 2005/11/16 21:39:51 andrew Exp $ ######################################################################## # update_trango.pl *** Updates trango foxes with a new firmware # @@ -44,14 +44,20 @@ my $host = new Net::Telnet (Timeout => 5, Prompt => '/#> *$/'); mylog("Connecting to $fox"); - $host->open($fox); + unless ( $host->open( Host => $fox, Errmode => 'return') ) { + mylog("Couldn't connect to $fox. Connection timed out.", LOG_SAVE); + next; + } $host->dump_log('dump.log'); ## Login to remote host. - $host->waitfor( + unless ($host->waitfor( -match => '/password: ?$/i', -errmode => "return", - ) or die "problem connecting to host ($fox): ", $host->lastline; + ) ) { + mylog("problem connecting to host ($fox): " . $host->lastline, LOG_SAVE); + next; + } my $login_banner = $host->lastline; my ($type, $version) = $login_banner =~