diff --git a/emhttp/plugins/dynamix/include/SmartInfo.php b/emhttp/plugins/dynamix/include/SmartInfo.php index 995e27a38..280604bb8 100644 --- a/emhttp/plugins/dynamix/include/SmartInfo.php +++ b/emhttp/plugins/dynamix/include/SmartInfo.php @@ -229,10 +229,10 @@ case "stop": exec("smartctl -X $type ".escapeshellarg("/dev/$port")); break; case "update": - if ($disk["transport"] == "scsi") { + if ($disk["transport"] == "scsi" || $disk["transport"] == "nvme") { $progress = exec("smartctl -n standby -l selftest $type ".escapeshellarg("/dev/$port")."|grep -Pom1 '\d+%'"); if ($progress) { - echo " "._('self-test in progress').", ".(100-substr($progress,0,-1))."% "._('complete').""; + if ($disk["transport"] == "nvme") echo " "._('self-test in progress').", ".(substr($progress,0,-1))."% "._('complete').""; else echo " "._('self-test in progress').", ".(100-substr($progress,0,-1))."% "._('complete').""; break; } } else { @@ -243,7 +243,8 @@ case "update": } } if ($disk["transport"] == "scsi") $result = trim(exec("smartctl -n standby -l selftest $type ".escapeshellarg("/dev/$port")."|grep -m1 '^# 1'|cut -c24-50")); - else $result = trim(exec("smartctl -n standby -l selftest $type ".escapeshellarg("/dev/$port")."|grep -m1 '^# 1'|cut -c26-55")); + else if ($disk["transport"] == "nvme") $result = trim(exec("smartctl -n standby -l selftest $type ".escapeshellarg("/dev/$port")."|grep -m1 '^ 0'|cut -c24-50")); + else $result = trim(exec("smartctl -n standby -l selftest $type ".escapeshellarg("/dev/$port")."|grep -m1 '^# 1'|cut -c26-55")); if (!$result) { $spundown = $disk['spundown'] ? "Device spundown, spinup to get information" : "No self-tests logged on this disk" ; echo ""._($spundown)."";