Last active
April 28, 2024 12:15
-
-
Save Nako/21d1a857fefae950d9afe8d9e4641af9 to your computer and use it in GitHub Desktop.
hard disk temperature, very simple script to print block device, model information, serial number, state, and temperature
This file contains 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 | |
# https://gist.github.com/Nako/21d1a857fefae950d9afe8d9e4641af9 | |
# very simple script to print block device - model - state - temperature | |
grep -l "drivetemp" /sys/class/hwmon/hwmon*/name | while read f;\ | |
do echo `ls ${f%/*}/device/block` - `smartctl -a /dev/\`ls ${f%/*}/device/block\`| grep -i "Family"` - `smartctl -a /dev/\`ls ${f%/*}/device/block\`| grep -i "Serial"` - `cat ${f%/*}/device/model` - `cat ${f%/*}/device/state` - $((`cat ${f%/*}/temp1_input`/1000)); | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment