--- fw-info.pl 2007/04/24 18:57:19 33 +++ fw-info.pl 2007/04/24 20:43:36 34 @@ -7,15 +7,17 @@ use strict; use Data::Dump qw/dump/; -my $path = shift @ARGV || '/srv/tftp/BANT-R'; # die "Usage: $0 firmware.bin\n"; +my @images = @ARGV; +push @images, '/srv/tftp/BANT-R' unless @images; my $magic = 'BLI223QH0'; -open(my $fh, $path) || die "Can't open $path: $!"; -my $b; -read($fh, $b, length($magic)); -die "# $path not a firmware image\n" unless ($b eq $magic); -seek($fh, 32, 0) || die "can't seek to 32: $!"; -read($fh, $b, 4); -printf("%8s %s\n", join('.',unpack('CCCC', $b)), $path); - +for my $path ( @images ) { + open(my $fh, $path) || die "Can't open $path: $!"; + my $b; + read($fh, $b, length($magic)); + warn "# $path not a firmware image\n" unless ($b eq $magic); + seek($fh, 32, 0) || die "can't seek to 32: $!"; + read($fh, $b, 4); + printf("%8s %s\n", join('.',unpack('CCCC', $b)), $path); +}