- #!/bin/bash
- if [ -z $1 ] ; then
- echo "No Paramters given."
- exit 1
- fi
- if [ "z${1}" == "zcpu" ] ; then
- cpu=$(</sys/class/thermal/thermal_zone0/temp)
- echo $((cpu/1000))
- exit 0
- elif [ "z${1}" == "zgpu" ] ; then
- gpu=$(/opt/vc/bin/vcgencmd measure_temp | cut -d "=" -f 2 | cut -d "'" -f 1)
- echo $gpu
- exit 0
- fi
|