Skip to content

Instantly share code, notes, and snippets.

@sdomi
Created May 19, 2018 11:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sdomi/1d4ff284ec0f0afa85b6567dd12b8c1c to your computer and use it in GitHub Desktop.
Save sdomi/1d4ff284ec0f0afa85b6567dd12b8c1c to your computer and use it in GitHub Desktop.
script for measuring raspberry pi's GPU and CPU temp (requires superuser for gpu)
#!/bin/bash
cpu=$(cat /sys/class/thermal/thermal_zone0/temp)
cpureal=$(echo $cpu | cut -c 1-2).$(echo $cpu | cut -c 3-6)\'C
gpu=$(vcgencmd measure_temp | cut -c 6-11)
echo "CPU: $cpureal | GPU: $gpu"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment