mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-02-12 11:01:52 +00:00
try lscpu if blank cpu_name
Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
parent
aaff3abc1a
commit
03cab630c7
1 changed files with 8 additions and 1 deletions
|
@ -117,9 +117,16 @@ function linux_identifiers()
|
||||||
|
|
||||||
var child = require('child_process').execFile('/bin/sh', ['sh']);
|
var child = require('child_process').execFile('/bin/sh', ['sh']);
|
||||||
child.stdout.str = ''; child.stdout.on('data', dataHandler);
|
child.stdout.str = ''; child.stdout.on('data', dataHandler);
|
||||||
child.stdin.write('cat /proc/cpuinfo | grep "model name" | ' + "tr '\\n' ':' | awk -F: '{ print $2 }'\nexit\n");
|
child.stdin.write('cat /proc/cpuinfo | grep -i "model name" | ' + "tr '\\n' ':' | awk -F: '{ print $2 }'\nexit\n");
|
||||||
child.waitExit();
|
child.waitExit();
|
||||||
identifiers['cpu_name'] = child.stdout.str.trim();
|
identifiers['cpu_name'] = child.stdout.str.trim();
|
||||||
|
if (identifiers['cpu_name'] == "") { // CPU BLANK, check lscpu instead
|
||||||
|
child = require('child_process').execFile('/bin/sh', ['sh']);
|
||||||
|
child.stdout.str = ''; child.stdout.on('data', dataHandler);
|
||||||
|
child.stdin.write('lscpu | grep -i "model name" | ' + "tr '\\n' ':' | awk -F: '{ print $2 }'\nexit\n");
|
||||||
|
child.waitExit();
|
||||||
|
identifiers['cpu_name'] = child.stdout.str.trim();
|
||||||
|
}
|
||||||
child = null;
|
child = null;
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue