Fix comments

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

View File

@ -149,28 +149,31 @@ choose_correct_type() {
}
## ]]]
# Get the arguments's list and check values
manage_arguments "${@}"
# Create files
# Create file
true > "${smart_device_list}"
# Get the list of all available devices
smartctl --scan >> "${smart_device_list}"
# If the devices list is not empty
if test -s "${smart_device_list}"; then
while IFS= read -r LINE; do
## Get device path
disk_path=$(echo "${LINE}" | cut -d" " -f1)
## Try to determine the best type
## Get scanned type
scanned_disk_type=$(echo "${LINE}" | cut -d" " -f3)
[ "${debug}" -eq "0" ] && printf "\n${c_magentab}%-6b${c_reset}\n" "DEBUG: smartctl scan ${disk_path} with TYPE ${scanned_disk_type}."
## Try to determine the best type
choose_correct_type "${disk_path}" "${scanned_disk_type}"
## If no correct type was found for this device
if [ -z "${disk_type}" ]; then
[ "${debug}" -eq "0" ] && printf "${c_magentab}%-6b${c_reset}\n" "DEBUG: SMART is not fully supported on ${disk_path}."
else
[ "${debug}" -eq "0" ] && printf "${c_magentab}%-6b${c_reset}\n" "DEBUG: for disk ${disk_path}, now use TYPE ${disk_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."
fi
done < "${smart_device_list}"