Run smartctl command to launch test

This commit is contained in:
Jeremy Gardais 2020-02-27 16:15:11 +01:00
parent a1bfb78037
commit 489983bedb
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 2 additions and 1 deletions

View File

@ -105,7 +105,7 @@ is_disk_path_support_smart() {
true > "${_smarctl_support_result}" true > "${_smarctl_support_result}"
## Grep only "support" lines from disk's informations ## Grep only "support" lines from disk's informations
smartctl -d "${_disk_type}" -i -- "${_disk_path}" | grep -E "^SMART support is:" -- >> "${_smarctl_support_result}" smartctl --device="${_disk_type}" --info -- "${_disk_path}" | grep -E "^SMART support is:" -- >> "${_smarctl_support_result}"
## If the file is not empty ## If the file is not empty
if test -s "${_smarctl_support_result}"; then if test -s "${_smarctl_support_result}"; then
@ -174,6 +174,7 @@ if test -s "${smart_device_list}"; then
[ "${debug}" -eq "0" ] && printf "${c_magentab}%-6b${c_reset}\n" "DEBUG: SMART is not fully supported on ${disk_path}." [ "${debug}" -eq "0" ] && printf "${c_magentab}%-6b${c_reset}\n" "DEBUG: SMART is not fully supported on ${disk_path}."
else else
[ "${debug}" -eq "0" ] && printf "${c_magentab}%-6b${c_reset}\n" "DEBUG: Run a ${test_to_run} SMART test on disk ${disk_path}, with ${disk_type} TYPE." [ "${debug}" -eq "0" ] && printf "${c_magentab}%-6b${c_reset}\n" "DEBUG: Run a ${test_to_run} SMART test on disk ${disk_path}, with ${disk_type} TYPE."
smartctl --device="${disk_type}" --test="${test_to_run}" -- "${disk_path}"
fi fi
done < "${smart_device_list}" done < "${smart_device_list}"