=================================================================== RCS file: /cvs/trango/Net-Telnet-Trango/scripts/update_trango.pl,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- trango/Net-Telnet-Trango/scripts/update_trango.pl 2005/11/18 19:17:12 1.9 +++ trango/Net-Telnet-Trango/scripts/update_trango.pl 2005/12/21 01:17:06 1.10 @@ -1,5 +1,5 @@ #!/usr/bin/perl -# $RedRiver: update_trango.pl,v 1.8 2005/11/17 20:20:59 andrew Exp $ +# $RedRiver: update_trango.pl,v 1.9 2005/11/18 19:17:12 andrew Exp $ ######################################################################## # update_trango.pl *** Updates trango foxes with a new firmware # @@ -125,25 +125,31 @@ my $results = $t->tftpd; # check the 'File Length' against ??? if ( $results->{'File Checksum'} ne $conf->{'file_cksum'}) { - $l->sp("File checksum does not match config file!"); + $l->sp( + "File checksum '" . $results->{'File Checksum'} . + "does not match config file '" . $conf->{'file_cksum'} . "'!" + ); next; } - $l->p("File checksum ($results->{'File Checksum'}) " . - "matches ($conf->{'file_cksum'})"); + $l->p("File checksum matches . . . "); if ($results->{'File Length'} !~ /^$conf->{'file_size'} bytes/) { - $l->sp("File length does not match config file!"); + $l->sp( + "File length '" . $results->{'File Length'} . + "does not match config file '" . $conf->{'file_size'} . " bytes'!" + ); next; } - $l->p("File length ($results->{'File Length'}) " . - "matches ($conf->{'file_size'})"); + $l->p("File length matches . . . "); if ( uc($results->{'File Name'}) ne uc($conf->{'file_name'}) ) { - $l->sp("File name does not match config file!"); + $l->sp( + "File name '" . $results->{'File Name'} . + "' does not match config file '" . $conf->{'file_name'} . "'!" + ); next; } - $l->p("File name ($results->{'File Name'}) " . - "matches ($conf->{'file_name'})"); + $l->p("File name matches . . . "); $l->p("Updating flash (new checksum '$conf->{'cksum'}')"); unless ($results = $t->updateflash( @@ -179,6 +185,8 @@ next if /^#/; next if /^$/; if ($in_ip_list) { + s/\s+//g; # Whitespace is a no no + if (/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.)(\d{1,3})-(\d{1,3})/) { push @{ $conf{'ips'} }, $1 . $_ for ($2..$3); } else { @@ -192,6 +200,11 @@ next; } + $key =~ s/^\s+//; + $key =~ s/\s+$//; + $val =~ s/^\s+//; + $val =~ s/\s+$//; + $conf{ lc($key) } = $val; } } @@ -294,7 +307,7 @@ my $banner = shift || $PRIVATE{'login_banner'}; my ($type, $ver) = $banner =~ - /Welcome to Trango Broadband Wireless (\w+)-(.+)$/i; + /Welcome to Trango Broadband Wireless (.+)[\s-](\w+)$/i; $self->host_type($type); $self->firmware_version($ver);