From d626f4308453e3bd1ec1126e4ac03ff847227053 Mon Sep 17 00:00:00 2001 From: Waldek Date: Thu, 25 Feb 2021 11:18:13 +0100 Subject: [PATCH] update info about setup CPU temp --- sysinfo/graph.sh | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/sysinfo/graph.sh b/sysinfo/graph.sh index 3e29230..3aed331 100755 --- a/sysinfo/graph.sh +++ b/sysinfo/graph.sh @@ -11,23 +11,25 @@ tempcpu=false # Setup temperature for CPU ============ -# For Raspberry PI: - -FILE=/sys/class/thermal/thermal_zone0/temp -if [[ -f "$FILE" ]]; then -tempC=`cat /sys/class/thermal/thermal_zone0/temp |awk '{printf("%.1f",$1)}'` -fi +# For Raspberry PI set tempcup=true and uncomnet below: +#FILE=/sys/class/thermal/thermal_zone0/temp +#if [[ -f "$FILE" ]]; then +#tempC=`cat /sys/class/thermal/thermal_zone0/temp |awk '{printf("%.1f",$1)}'` +#fi # For platform not like Raspberry PI install package # apt install lm-sensors -# and run: sensors-detect -# after this check result run command: sensors to see temperature CPU, if no set above tempcpu=false +# and run command: sensors-detect +# to setup sensors and +# next check result run command: sensors +# to see temperature CPU, if no set: tempcpu=false +# if sensors return temperature CPU set: tempcpu=true -# Remove when use for Raspberry PI (see above) -if $tempcpu == "True" ; then -tempC=`sensors | grep -i "Core 0" | grep "$1" | sed -re "s/.*:[^+]*?[+]([.0-9]+)[ °]C.*/\1/g"` -fi +# For PC where used sensors tools uncomnet below: +#if $tempcpu == "True" ; then +#tempC=`sensors | grep -i "Core 0" | grep "$1" | sed -re "s/.*:[^+]*?[+]([.0-9]+)[ °]C.*/\1/g"` +#fi #=====================================