From d24873e470f75b253a8b5771d430c19dde129edd Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Sat, 9 Jul 2022 22:43:01 +0200 Subject: [PATCH] cpuTemperature() simplified hwmon parsing --- lib/cpu.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cpu.js b/lib/cpu.js index e50e7a3..149e166 100644 --- a/lib/cpu.js +++ b/lib/cpu.js @@ -1039,7 +1039,7 @@ function cpuTemperature(callback) { util.noop(); } - const cmd = 'for mon in /sys/class/hwmon/hwmon*; do for label in "$mon"/temp*_label; do if [ -f $label ]; then value=$(echo $label | rev | cut -c 7- | rev)_input; if [ -f "$value" ]; then echo $(cat "$label")___$(cat "$value"); fi; fi; done; done;'; + const cmd = 'for mon in /sys/class/hwmon/hwmon*; do for label in "$mon"/temp*_label; do if [ -f $label ]; then value=${label%_*}_input; echo $(cat "$label")___$(cat "$value"); fi; done; done;'; try { exec(cmd, function (error, stdout) { stdout = stdout.toString();