Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- echo "drivetest="
- DRIVES=`fdisk -l | grep "Disk /dev" | gawk -F' ' '{ print $2 }'`
- COMMANDS=( 'smartctl -i DRIVE | grep Serial'
- 'smartctl -a DRIVE | grep Power_On_Hours'
- 'smartctl -a DRIVE | grep Temperature_Celsius'
- 'smartctl -a DRIVE | grep Reallocated_Sector_ct'
- 'smartctl -a DRIVE | grep Reallocated_Event_Count'
- 'smartctl -a DRIVE | grep Current_Pending_Sector'
- 'smartctl -a DRIVE | grep Offline_Uncorrectable'
- 'smartctl -H DRIVE | grep result'
- )
- for i in $(echo $DRIVES | tr ":" "\n")
- do
- # NUMBER=$[ ( $RANDOM % 100 ) + 1 ]
- # echo "&${NUMBER}=PROCESSING NEW DRIVE"
- for c in "${COMMANDS[@]}"
- do
- NEWCOMMAND=${c//'DRIVE'/$i}
- eval "$NEWCOMMAND"
- done
- # done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement