1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

fix mac memory and invalid smc values

Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
si458 2024-03-04 10:57:09 +00:00
parent 3ffc92e917
commit 548c1b9bb4
2 changed files with 27 additions and 29 deletions

View file

@ -305,9 +305,14 @@ function macos_thermals()
}
}
});
child.stderr.str = ''; child.stderr.on('data', function (c) { this.str += c.toString(); });
child.stdin.write('powermetrics -s smc\n');
child.waitExit(5000);
child.stderr.on('data', function (c) {
if (c.toString().split('unable to get smc values').length > 1) { // error getting sensors so just kill
this.parent.kill();
return;
}
});
child.stdin.write('powermetrics -s smc -i 500 -n 1\n');
child.waitExit(2000);
}
return (ret);
}