Minor fix
This commit is contained in:
parent
b31ac3cc90
commit
b4fd8bf2ac
1 changed files with 7 additions and 2 deletions
|
|
@ -72,7 +72,12 @@ main() {
|
||||||
|
|
||||||
# Get SMART health
|
# Get SMART health
|
||||||
local health="UNKNOWN"
|
local health="UNKNOWN"
|
||||||
if health=$(smartctl -H "$device" 2>/dev/null | grep -o "PASSED\|FAILED" | head -1); then
|
local smartctl_opts=""
|
||||||
|
if [[ "$is_nvme" == "true" ]]; then
|
||||||
|
smartctl_opts="-d nvme"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if health=$(smartctl $smartctl_opts -H "$device" 2>/dev/null | grep -o "PASSED\|FAILED" | head -1); then
|
||||||
echo " Health: $health"
|
echo " Health: $health"
|
||||||
else
|
else
|
||||||
health="UNKNOWN"
|
health="UNKNOWN"
|
||||||
|
|
@ -88,7 +93,7 @@ main() {
|
||||||
|
|
||||||
if [[ "$health" == "PASSED" ]]; then
|
if [[ "$health" == "PASSED" ]]; then
|
||||||
local smart_data
|
local smart_data
|
||||||
smart_data=$(smartctl -A "$device" 2>/dev/null)
|
smart_data=$(smartctl $smartctl_opts -A "$device" 2>/dev/null)
|
||||||
|
|
||||||
if [[ "$is_nvme" == "true" ]]; then
|
if [[ "$is_nvme" == "true" ]]; then
|
||||||
# NVMe attributes (different format)
|
# NVMe attributes (different format)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue