cpuTemperature() improved tdie detection (linus)
This commit is contained in:
+6
-1
@@ -967,7 +967,12 @@ function cpuTemperature(callback) {
|
||||
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;';
|
||||
try {
|
||||
exec(cmd, function (error, stdout) {
|
||||
let lines = stdout.toString().split('\n');
|
||||
stdout = stdout.toString();
|
||||
const tdiePos = stdout.toLowerCase().indexOf('tdie');
|
||||
if (tdiePos !== -1) {
|
||||
stdout = stdout.substring(tdiePos);
|
||||
}
|
||||
let lines = stdout.split('\n');
|
||||
lines.forEach(line => {
|
||||
const parts = line.split('___');
|
||||
const label = parts[0];
|
||||
|
||||
Reference in New Issue
Block a user