}
sub smart {
- open(my $fh, '-|', "smartctl -l selective $drive");
+ my $cmd = "smartctl -l selective $drive";
+ warn "$cmd\n";
+ open(my $fh, '-|', $cmd);
while(<$fh>) {
chomp;
print "# $_\n";
smart_test $sector;
return 1;
} elsif ( m/Self_test_in_progress/ ) {
+ $test_started = 1;
return 1;
} elsif ( m/Not_testing/ ) {
return 1 if $test_started;
}
while ( smart ) {
- warn "# sleep $delay s\n";
+ warn "sleep $delay s", ( $test_started ? " smart test running..." : "idle" ), "\n";
sleep $delay;
}