cpuTemperature() simplified hwmon parsing

This commit is contained in:
Sebastian Hildebrandt 2022-07-09 22:43:01 +02:00
parent f3b8a4ad36
commit d24873e470

View File

@ -1039,7 +1039,7 @@ function cpuTemperature(callback) {
util.noop(); 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 { try {
exec(cmd, function (error, stdout) { exec(cmd, function (error, stdout) {
stdout = stdout.toString(); stdout = stdout.toString();