(12-25-2018, 01:19 PM)Neo2018 Wrote:(12-25-2018, 07:39 AM)tuxd3v Wrote: You can find via SysFs the Temperature on this locations:I did not expect such a quick response, thank you.
Code:root@rockpro64:/# find /sys/class/thermal/thermal_zone{0,1}/ -name temp -exec ls {} \; -exec cat {} \;
/sys/class/thermal/thermal_zone0/temp
53888
/sys/class/thermal/thermal_zone1/temp
45000
I forgot to mention that, of course, I also found this command (in /etc/ats.conf) and used. I was not sure if he was right.
That's right? Or can do better? Can you do it with decimal? So> 39.4°CCode:#!/bin/bash
TEMP1=`awk '{print substr($1,1,2)}' /sys/class/thermal/thermal_zone1/temp`
TEMP=`awk '{print substr($1,1,2)}' /sys/class/thermal/thermal_zone0/temp`
echo "
\033[0;35m+ \033[0;37mTemperatur \033[0;35m= \033[1;32mCPU $TEMP C GPU $TEMP1 C
"tput sgr0
output>
root@RockHomeServer:~# sh te.sh
+ Temperatur = CPU 39°C GPU 38°C
Perfect thank you
Ps: Waiting for the delivery from Aliexpress "KSD9700 40-NO" is coming soon!
Its ok, you can also use decimal values with awk..
Code:
TEMP=`awk '{ print substr( $1, 1, 3 ) / 10 }' /sys/class/thermal/thermal_zone0/temp`
TEMP1=`awk '{ print substr( $1, 1, 3 ) / 10 }' /sys/class/thermal/thermal_zone1/temp`
You welcome.
Regards