]> git.nbdom.net Git - nb.git/commitdiff
etc/profile.d/sys.sh
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 16 May 2019 04:01:34 +0000 (05:01 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 16 May 2019 04:01:34 +0000 (05:01 +0100)
etc/profile.d/sys.sh

index 64864ff589eff457f230406c0a0809372f6acdb0..15f770ad3550de2f10aa7af3a163aa322df356e1 100644 (file)
@@ -228,12 +228,12 @@ sys_cpu_load() {
 }
 
 sys_cpu_temperature() {
-  # Mac, others
-  # /sys/devices/platform/applesmc.768/temp*input
-  (
-       cat /sys/devices/platform/coretemp.0/hwmon/hwmon*/temp*_input \
-       || cat /sys/class/thermal/thermal_zone*/temp
-  ) | awk '/^[0-9]/ {printf("%.1f\n",$1/1000)}'
-# NB 13.05.19   awk '{printf("%.1f\n",$1/1000)}' /sys/class/thermal/thermal_zone*/temp
-  #awk '{ count++; sum+=$1 } END {printf("%.1f",sum/count/1000)}' /sys/class/thermal/thermal_zone*/temp
+       # Mac, others
+       # /sys/devices/platform/applesmc.768/temp*input
+       (
+        cat /sys/devices/platform/coretemp.0/hwmon/hwmon*/temp*_input \
+        || cat /sys/class/thermal/thermal_zone*/temp
+       ) 2>/dev/null | awk '/^[0-9]/ {printf("%.1f\n",$1/1000)}'
+       # NB 13.05.19   awk '{printf("%.1f\n",$1/1000)}' /sys/class/thermal/thermal_zone*/temp
+       #awk '{ count++; sum+=$1 } END {printf("%.1f",sum/count/1000)}' /sys/class/thermal/thermal_zone*/temp
 }