diff --git a/stocheck.sh b/stocheck.sh index 0990946..13d5e0a 100644 --- a/stocheck.sh +++ b/stocheck.sh @@ -17,7 +17,9 @@ while [ -z "$1" ]; do scan=$(smartctl --scan) if [[ -n $(echo $scan | grep /dev/sd$x) ]];then echo "------------------- /dev/sd$x --------------------" - smartctl -H -i /dev/sd$x; + smartctl -i /dev/sd$x | grep -e "=== START OF INFORMATION SECTION ===" -e "Device Model:" -e "Serial Number:" -e "Firmware Version:" -e "User Capacity:" -e "SMART support is:" -e "Sector Size:" -e "Rotation Rate:" + echo "" + smartctl -A /dev/sd$x | grep -e "=== START OF READ SMART DATA SECTION ===" -e "SMART overall-health self-assessment test result:" -e "Reallocated_Sector_Ct" -e "Power_On_Hours" -e "Temperature_Celsius" -e "Media_Wearout_Indicator" -e "Power_Cycle_Count" -e "Reported_Uncorrect" echo "-------------------------------------------------" else exit @@ -33,7 +35,9 @@ while [ -z "$1" ]; do scan=$(smartctl --scan) if [[ -n $(echo $scan | grep /dev/nvme$x) ]];then echo "------------------- /dev/nvme$x --------------------" - smartctl -H -i /dev/nvme$x; + smartctl -i /dev/nvme$x | grep -e "=== START OF INFORMATION SECTION ===" -e "Device Model:" -e "Serial Number:" -e "Firmware Version:" -e "User Capacity:" -e "SMART support is:" -e "Sector Size:" -e "Rotation Rate:" + echo "" + smartctl -A /dev/nvme$x | grep -e "=== START OF READ SMART DATA SECTION ===" -e "SMART overall-health self-assessment test result:" -e "Reallocated_Sector_Ct" -e "Power_On_Hours" -e "Temperature_Celsius" -e "Media_Wearout_Indicator" -e "Power_Cycle_Count" -e "Reported_Uncorrect" echo "---------------------------------------------------" fi done