From ddff71dd79015659ffbfebb08ccc55f3d41cf5c1 Mon Sep 17 00:00:00 2001 From: Bryan Roe Date: Mon, 24 Jun 2019 15:02:10 -0700 Subject: [PATCH] freebsd update for proxy detection, when running as service --- meshcore/agentcore.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/meshcore/agentcore.c b/meshcore/agentcore.c index 60a5c3f..075544d 100644 --- a/meshcore/agentcore.c +++ b/meshcore/agentcore.c @@ -413,9 +413,9 @@ int MeshAgent_GetSystemProxy(MeshAgentHostContainer *agent, char *buffer, size_t char getProxy[] = "(function getProxies(){\ var child = require('child_process').execFile('/bin/sh', ['sh']);\ child.stdout.str = ''; child.stdout.on('data', function (c) { this.str += c.toString(); });\ - child.stdin.write('cat /etc/login.conf | grep :setenv = | awk - F\":setenv=\" \\'{ if(!($1 ~ /^#/)) { print $2 } }\\' | tr \\'\\,\\' \\'\\n\\' | awk -F= \\'{ if($1==\"https_proxy\") { gsub(/\\\\c/, \":\", $2); print $2 } }\\'\\n\\exit\\n');\ + child.stdin.write('cat /etc/login.conf | grep :setenv= | awk -F\":setenv=\" \\'{ if(!($1 ~ /^#/)) { print $2 } }\\' | tr \"\\,\" \"\\n\" | awk -F= \\'{ if($1==\"https_proxy\") { gsub(/\\\\\\\\c/, \":\", $2); print $2 } }\\'\\n\\exit\\n');\ child.waitExit();\ - return(child.stdout.str.trim().split('\\n')[0]);\ + return(child.stdout.str.trim().split('\\n')[0].split('//')[1]);\ })();"; #else char getProxy[] = "(function getProxies(){\ @@ -3376,6 +3376,10 @@ void MeshServer_ConnectEx(MeshAgentHostContainer *agent) else { printf("Using proxy: %s\n", ILibScratchPad); + if(agent->logUpdate != 0) + { + ILIBLOGMESSAGEX("Using proxy: %s", ILibScratchPad); + } if (delimiter > 0) { ILibScratchPad[delimiter] = 0;