Skip to content

Instantly share code, notes, and snippets.

@jfeilbach
Last active April 11, 2019 19:29
Show Gist options
  • Select an option

  • Save jfeilbach/2bf6fc035423ce7802a7fcff6662c75c to your computer and use it in GitHub Desktop.

Select an option

Save jfeilbach/2bf6fc035423ce7802a7fcff6662c75c to your computer and use it in GitHub Desktop.
Get disk temperatures in Fahrenheit
#!/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