From 465a246cb65575321e84a2fda40cd2f60c2c9236 Mon Sep 17 00:00:00 2001 From: Olli Graf Date: Sun, 26 Nov 2023 13:51:46 +0100 Subject: [PATCH] =?UTF-8?q?endg=C3=BCltige=20Replacement=20Version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vcgencmd | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 vcgencmd diff --git a/vcgencmd b/vcgencmd new file mode 100755 index 0000000..f26a69d --- /dev/null +++ b/vcgencmd @@ -0,0 +1,20 @@ +#! /usr/bin/bash + +# Replacement for Raspberry Pi OS' vcgencmd on non Raspian SBC + +cpu_temp=$(cat /sys/class/thermal/thermal_zone0/temp) +gpu_temp=$(cat /sys/class/thermal/thermal_zone0/temp) + +function print_temp { + ftemp=${2:0:2} + + ftemp+="." + ftemp+=${2:2:1} + + echo "temp="${ftemp} +} + +cpu_temp=$(cat /sys/class/thermal/thermal_zone0/temp) +cpu_temp=$(cat /sys/class/thermal/thermal_zone1/temp) +print_temp "CPU=" "${cpu_temp}" +#print_temp "GPU=" "${gpu_temp}"