1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-30 23:23:32 +00:00

updated findEnv() for freebsd

This commit is contained in:
Bryan Roe
2019-06-22 01:23:23 -07:00
parent ae3bff9e18
commit 422e342a5e

View File

@@ -641,7 +641,7 @@ function UserSessions()
var child = require('child_process').execFile('/bin/sh', ['sh']);
child.stdout.str = '';
child.stdout.on('data', function (chunk) { this.str += chunk.toString(); });
child.stdin.write("ps -e -o pid -o user | grep " + uname + " | awk '{ print $1 }'\nexit\n");
child.stdin.write("ps " + (process.platform == 'freebsd' ? "-ax ":"") + "-e -o pid -o user | grep " + uname + " | awk '{ print $1 }'\nexit\n");
child.waitExit();
var lines = child.stdout.str.split('\n');