Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # install the smartctl package first! (apt-get install smartctl)
- if sudo true
- then
- true
- else
- echo 'Root jog kell'
- exit 1
- fi
- for drive in /dev/sd[a-z] /dev/sd[a-z][a-z]
- do
- if [[ ! -e $drive ]]; then continue ; fi
- echo -n "$drive "
- smart=$(
- sudo lsblk $drive |
- grep 'part' &&
- sudo smartctl -a -d sat $drive 2>/dev/null |
- grep 'Device Model\|result:\|Reallocated_Sector_Ct\|Current_Pending_Sector\|Raw_Read_Error\|End-to-End\|Supercap_Status\|Temperature_Celsius' |
- awk '{ print }'
- )
- [[ "$smart" == "" ]] && smart='unavailable'
- echo "$smart"
- echo "$smart" | mail -s "KODI server DISK STATUS" [email protected]
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement