Corrected a few syntax errors and cleaned up time output

This commit is contained in:
bluesaxman 2022-03-08 13:18:34 -07:00
parent 3041e409ed
commit 40a7cfff21

10
wipe.pl
View File

@ -173,11 +173,12 @@ sub wipethemdrives {
system("hdparm -F ".$disks->{$diskid}{path}." 1>/dev/null 2>/dev/null"); system("hdparm -F ".$disks->{$diskid}{path}." 1>/dev/null 2>/dev/null");
} }
if ( !($_ % 16) ) { if ( !($_ % 16) ) {
printf("\r%31.31s%-".($spacer+11).".".($spacer+11)."s%6.2f%% %s", my @diskTimes = gmtime((time()-$diskStartTime)*($totalBytes/tell($longdiskw)));
printf("\r%31.31s%-".($spacer+11).".".($spacer+11)."s%6.2f%% %-20s",
"Zeroing ".$disks->{$diskid}{path}, "Zeroing ".$disks->{$diskid}{path},
"."x(tell($longdiskw)/$totalBytes*($spacer+11)), "."x(tell($longdiskw)/$totalBytes*($spacer+11)),
(tell($longdiskw)/$totalBytes)*100 ), (tell($longdiskw)/$totalBytes)*100 ,
"ETA: ".gmtime((time()-$diskStartTime)*($totalBytes/tell($longdiskw))); "ETA: ".$diskTimes[7].", )".$diskTimes[2].":".$diskTimes[1].":".$diskTimes[0];
} }
} }
my $leftover = $totalBytes - tell($longdiskw); my $leftover = $totalBytes - tell($longdiskw);
@ -250,7 +251,8 @@ while () {
$currentCount++; $currentCount++;
print "="x80; print "="x80;
print "\nCurrent Overall Progress ".$currentCount."/".$batchcount." (".sprintf("%5f%%",100*$currentCount/$batchcount).")\n"; print "\nCurrent Overall Progress ".$currentCount."/".$batchcount." (".sprintf("%5f%%",100*$currentCount/$batchcount).")\n";
print "Current Overall ETA: ".gmtime((time() - $startTime) * ($batchcount/$currentCount))."\n"; my @overTime = gmtime((time() - $startTime) * ($batchcount/$currentCount));
print "Current Overall ETA: ".$overTime[7].", ".$overTime[2].":".$overTime[1].":".$overTime[0]."\n";
print "="x33; print "="x33;
printf '[ %-10s ]', $diskid; printf '[ %-10s ]', $diskid;
say "="x33; say "="x33;