["${debug}" -eq "0"]&&printf"${c_magentab}%-6b${c_reset}\n""DEBUG: is_disk_path_support_smart func − check if SMART is supported on: ${_disk_path} with ${_disk_type} TYPE."
## Create file
true > "${_smarctl_support_result}"
## Grep only "support" lines from disk's informations
if ! printf -- '%s'"${_line}"| grep -q -E -- "(Enabled|Available)"
then
smart_support_msg="${_line}"
["${debug}" -eq "0"]&&printf"${c_magentab}%-6b${c_reset}\n""DEBUG: is_disk_path_support_smart func − SMART is not fully supported on: ${_disk_path} with ${_disk_type} TYPE. See smartctl informations:\n${smart_support_msg}"
fi
done < "${_smarctl_support_result}"
else
smart_support_msg="ERROR: Enable to open ${_disk_path} DEVICE with ${_disk_type} TYPE. Be sure to have sufficient permission for this device."
printf"${c_redb}%-6b${c_reset}\n""ERROR: Enable to open ${_disk_path} DEVICE with ${_disk_type} TYPE. Be sure to have sufficient permission for this device."
fi
}
## ]]]
## Test the type of disk with smartctl [[[
## Cause the scanned one might not be the one to use
choose_correct_type(){
_disk_path="${1}"
_scanned_disk_type="${2}"
_default_disk_type="auto"
disk_type=""
for _test_disk_type in "${_default_disk_type}""${_scanned_disk_type}";do