Last active
April 11, 2019 19:29
-
-
Save jfeilbach/2bf6fc035423ce7802a7fcff6662c75c to your computer and use it in GitHub Desktop.
Get disk temperatures in Fahrenheit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # list the temperatures of all sd devices and convert it to Fahrenheit | |
| # Will get temp for USB devices as well | |
| for i in /dev/sd? ; do | |
| temp=$(smartctl --all ${i} | grep "^194" | awk '{ print $10 }' | awk -v RS=" " '{printf("%.1f ",$1*1.8+32)}') | |
| echo ${i} ${temp} deg F | |
| done | |
| exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment