1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-15 15:53:55 +00:00

Added cpu_name for linux

This commit is contained in:
Bryan Roe
2020-04-26 13:41:40 -07:00
parent 1db2b400d1
commit 8ec340f8b5
2 changed files with 7 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@@ -47,6 +47,12 @@ function linux_identifiers()
identifiers['board_version'] = ret['board_version'];
identifiers['product_uuid'] = ret['product_uuid'];
var child = require('child_process').execFile('/bin/sh', ['sh']);
child.stdout.str = ''; child.stdout.on('data', function (c) { this.str += c.toString(); });
child.stdin.write('cat /proc/cpuinfo | grep "model name" | ' + "tr '\\n' ':' | awk -F: '{ print $2 }'\nexit\n");
child.waitExit();
identifiers['cpu_name'] = child.stdout.str.trim();
values.identifiers = identifiers;
values.linux = ret;
trimIdentifiers(values.identifiers);