mirror of
https://forge.murkfall.net/bluesaxman/squeegy.git
synced 2026-03-13 03:14:21 -06:00
added check for smart self assesment
This commit is contained in:
7
wipe.pl
7
wipe.pl
@@ -137,7 +137,12 @@ sub smartcheck {
|
|||||||
# Do our smart disk thing...
|
# Do our smart disk thing...
|
||||||
my $diskid = shift;
|
my $diskid = shift;
|
||||||
my $disks = shift;
|
my $disks = shift;
|
||||||
say"Checking S.M.A.R.T. variables...";
|
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");
|
# 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);
|
(my $smartcommand = `smartctl $disks->{$diskid}{path} -A -f hex,id | grep "^0x"`) or (say "$!\ncould not check smart data, skipping" and return 1);
|
||||||
for (split("\n",$smartcommand)) {
|
for (split("\n",$smartcommand)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user