russel053/ 八月 17, 2019/ Raspberry Pi

Script:

nano temp.sh

#!/bin/bash
cpu=$(</sys/class/thermal/thermal_zone0/temp)
echo "$(date) @ $(hostname)"
echo "-------------------------------------------"
echo "GPU => $(/opt/vc/bin/vcgencmd measure_temp)"
echo "CPU => $((cpu/1000))'C"

nano tempmon.sh

#!/bin/bash
echo "Press [ctrl+c] to end monitoring"
echo ""
while true
do
  vcgencmd measure_temp
  sleep 3s
done

 

Share this Post