1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-23 19:53:47 +00:00

test script

This commit is contained in:
Bryan Roe
2019-01-24 07:54:48 -08:00
parent cf856b0d1d
commit bf6e9ce1e0

16
test/authtest.js Normal file
View File

@@ -0,0 +1,16 @@
var child = require('child_process').execFile('/bin/sh', ['sh']);
child.stdout.str = '';
child.stdin.write('ps -e -o user -o command | awk {\'printf "%s,",$1;$1="";printf "%s\\n", $0\'} | grep X\nexit\n');
child.stdout.on('data', function (chunk) { this.str += chunk.toString(); });
child.waitExit();
var lines = child.stdout.str.split('\n');
for (var i in lines)
{
var tokens = lines[i].split(',');
console.log(tokens[0] + ' => ' + tokens[1]);
}
//console.log(child.stdout.str);
process.exit();