#!/usr/local/bin/perl
# fsck.cgi
# Do the actual checking of a filesystem

require './format-lib.pl';
&ReadParse();
&can_edit_disk($in{'dev'}) || &error($text{'fsck_ecannot'});
&header($text{'fsck_title'}, "");
print "<hr>\n";
$in{dev} =~ s/dsk/rdsk/g;
$cmd = "fsck -F ufs $in{mode} $in{dev}";

print &text('fsck_exec', "<tt>$cmd</tt>"),"<p>\n";
print "<pre>\n";
open(FSCK, "$cmd 2>&1 </dev/null |");
while(<FSCK>) { print; }
close(FSCK);
print "</pre>\n";
print "... ",&fsck_error($?/256),"<p>\n";

print "<hr>\n";
&footer("", $text{'index_return'});

