#!/usr/local/bin/perl push( @INC, "/usr/local/lib/perl5" ); # MD5 for a selected file from an archive and return that as the document # This script is based on leo-findex by Maex Stumpf et al(?) # Karl Ewald, 85635 Hoehenkirchen, Germany; ewald@leo.org # path is archive file. require "a2h-config.pl"; $archfile = $ENV{'PATH_INFO'}; $full_path = $ARCHIV_ROOT . $archfile; if ( ! -d $full_path && ! -f $full_path ) { print "Status: 404 Not Found\r\n"; print "Server: $ENV{'SERVER_SOFTWARE'}\r\n"; print "Gateway-Interface: $ENV{'GATEWAY_INTERFACE'}\r\n"; print "MIME-version: 1.0\r\n"; # print "Content-length: 100\n"; print "Content-type: text/html\r\n\r\n"; print "
\n"; print "\n"; exit(0); } #print "HTTP/1.0 200 Document follows\n"; print "Server: $ENV{'SERVER_SOFTWARE'}\r\n"; print "Gateway-Interface: $ENV{'GATEWAY_INTERFACE'}\r\n"; print "MIME-version: 1.0\r\n"; print "Content-type: text/html\r\n\r\n"; print "
\n"; } print $md5_explain; print "
";
printf("%-30s %s\n\n", "Filename", "MD5 fingerprint");
foreach $file (@files) {
next if ($file eq '.');
next if ($file eq '..');
next if ($file eq '00-index.html');
next if ($file =~ /^\..*/o );
next if ($file =~ /^.*\.idx$/o );
$fname = "$dir/$file";
if ( -f $fname ) {
$md5 = `$md5_prog $full_path/$file`;
$md5 =~ s/^.*\=//;
printf("%-30s %s", $file, $md5);
}
}
close(FH);
print "";
}