Skip to content

Instantly share code, notes, and snippets.

@tomzaku
Created September 8, 2016 07:16
Show Gist options
  • Save tomzaku/f24557e0830919b0798c54be090e4539 to your computer and use it in GitHub Desktop.
Save tomzaku/f24557e0830919b0798c54be090e4539 to your computer and use it in GitHub Desktop.
Script Bash
Linux :
wget -qO- http://ipecho.net/plain ; echo
Mac :
curl -0q http://ipecho.net/plain ; echo
cpuTemp0=$(cat /sys/class/thermal/thermal_zone0/temp)
cpuTemp1=$(($cpuTemp0/1000))
cpuTemp2=$(($cpuTemp0/100))
cpuTempM=$(($cpuTemp2 % $cpuTemp1))
echo CPU temp"="$cpuTemp1"."$cpuTempM"'C"
echo GPU $(/opt/vc/bin/vcgencmd measure_temp)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment