cpu1=$(</sys/class/thermal/thermal_zone0/temp)
cpu2=$(echo "scale=1;$cpu1/1000" | bc)
gpu1=$(/opt/vc/bin/vcgencmd measure_temp)
gpu2=$(echo $gpu1 | tr -dc '.,0-9')
echo "$(date +'%d.%m.%Y %H:%M:%S') @ $(hostname)"
echo "CPU: $cpu2"
echo "GPU: $gpu2"
Wednesday, April 14, 2021
Print Raspberry Pi CPU and GPU temperature
Labels:
bash,
raspberry pi
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment