Last active
August 5, 2022 20:42
-
-
Save spajak/fc0fc1bfae72fb52a7165801176c7382 to your computer and use it in GitHub Desktop.
Raspberry Pi - get CPU and GPU 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 | |
cpu=$(</sys/class/thermal/thermal_zone0/temp) | |
cpu=$(printf %.1f "${cpu}e-3") | |
gpu=$(vcgencmd measure_temp) | |
gpu=${gpu:5:-2} | |
echo "CPU: ${cpu} °C" | |
echo "GPU: ${gpu} °C" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment