Files
snmp_temp/snmp_temp.sh
2022-01-12 08:41:20 +01:00

15 lines
320 B
Bash

#!/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