#!/bin/bash
  
 start_stop=0
 realloc=0
 seek_error_rate=0
 temp=0
 ecc=0
  
 /usr/bin/sudo /usr/local/sbin/smartctl -a $1 | tail +8 | { while read id name flag value worst thresh type when blank raw; do
         case $name in
                 Start_Stop_Count) start_stop=$raw ;;
                 Reallocated_Sector_Ct) realloc=$raw ;;
                 Seek_Error_Rate) seek_error_rate=$raw ;;
                 Temperature_Celsius) temp=$raw ;;
                 Hardware_ECC_Recovered) ecc=$raw ;;
         esac
 done
 echo "$start_stop $realloc $seek_error_rate $temp $ecc"
 }
