Created
July 11, 2021 14:52
-
-
Save mancap314/8e26a6eadfde0223661dec2006692768 to your computer and use it in GitHub Desktop.
Display highest thermal zone temperature (°C, Linux)
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 | |
max_temperature=0 | |
for d in /sys/class/thermal/thermal_zone* ; do | |
temperature=$(cat ${d}/temp) | |
if [[ $max_temperature -eq 0 || $temperature -gt $max_temperature ]]; then | |
max_temperature="${temperature}"; | |
fi | |
done | |
max_temperature=$(( max_temperature / 1000 )) | |
echo ${max_temperature} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment