1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-11 13:53:37 +00:00

Added support for fetching system proxy settings from gnome

This commit is contained in:
Bryan Roe
2019-08-12 11:27:15 -07:00
parent 7fa076a0cb
commit bc2ef6a3f4
3 changed files with 27 additions and 7 deletions

View File

@@ -554,6 +554,16 @@ function UserSessions()
}
return (ret);
}
this.loginUids = function loginUids()
{
var min = this.minUid();
var child = require('child_process').execFile('/bin/sh', ['sh']);
child.stderr.str = ''; child.stderr.on('data', function (chunk) { this.str += chunk.toString(); });
child.stdout.str = ''; child.stdout.on('data', function (chunk) { this.str += chunk.toString(); });
child.stdin.write('getent passwd | awk -F: \'{ if($3 >= ' + min + ') { a=split($7,b,"/"); if(b[a]!="nologin") { print $3; } }}\' | tr "\\n" "\\," | awk \'{ printf "[%s]", $0; }\'\nexit\n');
child.waitExit();
return (JSON.parse(child.stdout.str.trim().replace(',]',']')));
}
this.consoleUid = function consoleUid()
{
var child = require('child_process').execFile('/bin/sh', ['sh']);