'snmp_temp.sh' ändern

This commit is contained in:
2022-01-12 08:41:20 +01:00
parent 5e96a54fd3
commit 51dc2f9092

15
snmp_temp.sh Normal file
View File

@@ -0,0 +1,15 @@
#!/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