mirror of
				https://github.com/Ylianst/MeshCentral.git
				synced 2025-03-09 15:40:18 +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']);
 | 
			
		||||
    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();
 | 
			
		||||
    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;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue