mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-14 15:23:39 +00:00
fixed getEnvFromPid() for freebsd
This commit is contained in:
@@ -622,8 +622,9 @@ function UserSessions()
|
|||||||
{
|
{
|
||||||
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', function (c) { this.str += c.toString(); });
|
child.stdout.str = ''; child.stdout.on('data', function (c) { this.str += c.toString(); });
|
||||||
child.stdin.write("procstat -e " + pid + " | grep " + pid + " | awk '{ $1=\"\"; $2=\"\"; print $0 }' | tr \"\\ \" \"\\n\" | awk -F= '{ if($1==\"\") { print $0 }}'\nexit\n");
|
child.stdin.write("procstat -e " + pid + " | grep " + pid + " | awk '{ $1=\"\"; $2=\"\"; print $0 }' | tr \"\\ \" \"\\n\"\nexit\n");
|
||||||
child.waitExit();
|
child.waitExit();
|
||||||
|
|
||||||
var env;
|
var env;
|
||||||
var tokens = child.stdout.str.trim().split('\n');
|
var tokens = child.stdout.str.trim().split('\n');
|
||||||
for(var i in tokens)
|
for(var i in tokens)
|
||||||
@@ -887,4 +888,4 @@ function getTokens(str)
|
|||||||
return (columns);
|
return (columns);
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = new UserSessions();
|
module.exports = new UserSessions();
|
||||||
|
|||||||
Reference in New Issue
Block a user