added check for smart self assesment
This commit is contained in:
parent
da6cd39b4a
commit
97e3b5f41e
5
wipe.pl
5
wipe.pl
@ -137,6 +137,11 @@ sub smartcheck {
|
||||
# Do our smart disk thing...
|
||||
my $diskid = shift;
|
||||
my $disks = shift;
|
||||
say "Checking overall-health self-assessment test result: ";
|
||||
(my $smartassess = `smartctl /dev/sda -H | grep overall`) or (say "$!\ncould not check smart data, skipping" and return 1);
|
||||
$disks->{$diskid}{smart}{selftest} = (split(": ", $smartassess))[1];
|
||||
if ( "FAILED" == $disks->{$diskid}{smart}{selftest} ) { say "$color{red}Failed$color{reset}"; return 0
|
||||
} else { say "$color{green}Passed$color{reset}\n"; }
|
||||
say "Checking S.M.A.R.T. variables...";
|
||||
# say qq(smartctl $disks->{$diskid}{path} -A -f hex,id | grep "^0x");
|
||||
(my $smartcommand = `smartctl $disks->{$diskid}{path} -A -f hex,id | grep "^0x"`) or (say "$!\ncould not check smart data, skipping" and return 1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user