Skip to content

Instantly share code, notes, and snippets.

@mancap314
Created July 11, 2021 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mancap314/8e26a6eadfde0223661dec2006692768 to your computer and use it in GitHub Desktop.
Save mancap314/8e26a6eadfde0223661dec2006692768 to your computer and use it in GitHub Desktop.
Display highest thermal zone temperature (°C, Linux)
#!/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