mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-18 09:13:14 +00:00
updated getProxySettings() to include exceptions array
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -7,6 +7,7 @@ function gnome_getProxySettings(uid)
|
|||||||
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('gsettings list-recursively org.gnome.system.proxy | tr "\\n" "\\|" | tr "\\\'" "\\`" | awk \'{ count=split($0, res, "|");')
|
child.stdin.write('gsettings list-recursively org.gnome.system.proxy | tr "\\n" "\\|" | tr "\\\'" "\\`" | awk \'{ count=split($0, res, "|");')
|
||||||
|
child.stdin.write('exc="[]";');
|
||||||
child.stdin.write('for(a=0;a<count;++a)');
|
child.stdin.write('for(a=0;a<count;++a)');
|
||||||
child.stdin.write('{');
|
child.stdin.write('{');
|
||||||
child.stdin.write('split(res[a], modecheck, " ");');
|
child.stdin.write('split(res[a], modecheck, " ");');
|
||||||
@@ -16,10 +17,10 @@ function gnome_getProxySettings(uid)
|
|||||||
child.stdin.write('}');
|
child.stdin.write('}');
|
||||||
child.stdin.write('if(modecheck[1]=="org.gnome.system.proxy.http" && modecheck[2]=="host") { split(modecheck[3], hst, "`"); host = hst[2]; }');
|
child.stdin.write('if(modecheck[1]=="org.gnome.system.proxy.http" && modecheck[2]=="host") { split(modecheck[3], hst, "`"); host = hst[2]; }');
|
||||||
child.stdin.write('if(modecheck[1]=="org.gnome.system.proxy.http" && modecheck[2]=="port") { port = modecheck[3]; }');
|
child.stdin.write('if(modecheck[1]=="org.gnome.system.proxy.http" && modecheck[2]=="port") { port = modecheck[3]; }');
|
||||||
|
child.stdin.write('if(modecheck[1]=="org.gnome.system.proxy" && modecheck[2]=="ignore-hosts") { exc = substr(res[a], 36); gsub("`", "\\"", exc); }');
|
||||||
child.stdin.write('}');
|
child.stdin.write('}');
|
||||||
child.stdin.write('printf "{\\"mode\\": \\"%s\\", \\"host\\": \\"%s\\", \\"port\\": %s}", mode, host, port; }\'\nexit\n');
|
child.stdin.write('printf "{\\"mode\\": \\"%s\\", \\"host\\": \\"%s\\", \\"port\\": %s, \\"exceptions\\": %s}", mode, host, port, exc; }\'\nexit\n');
|
||||||
child.waitExit();
|
child.waitExit();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return (JSON.parse(child.stdout.str.trim()));
|
return (JSON.parse(child.stdout.str.trim()));
|
||||||
|
|||||||
Reference in New Issue
Block a user