From 072ba0698eb43acfe04812f2e06727acaeafb7bd Mon Sep 17 00:00:00 2001 From: Eduard Marbach Date: Fri, 14 Feb 2020 18:16:06 +0100 Subject: [PATCH] Add support for providing multiple proxies --- README.md | 17 +++++++++-------- start.sh | 6 +++++- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 84309a9..c031e2e 100644 --- a/README.md +++ b/README.md @@ -61,14 +61,15 @@ docker run \ Other settings you might want to use are: -| Variable| Description | -| --- | --- | -| LISTEN | The IP/hostname and port (separated by a colon) to listen to. I.e. "127.0.0.1:8080" | -| PASSNTLMV2 | Required for auth method Auth NTLMv2. | -| AUTH | Auth parameter. | -| PASSNT | Required for auth method Auth NTLM2SR, Auth NT and Auth NTLM. | -| PASSLM | Required for auth method Auth LM and Auth NTLM. | -| OPTIONS | Optional variable to enable cntlm features. I.e. for debugging: "-v". | +| Variable | Description | Example | +| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------- | +| LISTEN | The IP/hostname and port (separated by a colon) to listen to. | `127.0.0.1:8080` | +| PASSNTLMV2 | Required for auth method Auth NTLMv2. | | +| AUTH | Auth parameter. | | +| PASSNT | Required for auth method Auth NTLM2SR, Auth NT and Auth NTLM. | | +| PASSLM | Required for auth method Auth LM and Auth NTLM. | | +| PROXY | A proxy list the traffic is send to. Can be a list separated by `;`. Will be splitted into multiple `Proxy ...` lines in the `cntlm.conf`. | `localhost:3128;localhost:3129` | +| OPTIONS | Optional variable to enable cntlm features. | `-v` for debugging | Find [technical details here](http://cntlm.sourceforge.net/cntlm_manual.pdf). diff --git a/start.sh b/start.sh index f4c5c4e..95f760d 100644 --- a/start.sh +++ b/start.sh @@ -13,7 +13,11 @@ fi echo "Domain ${DOMAIN}" | tee -a /etc/cntlm.conf if [ "${PROXY}" ] ; then - echo "Proxy ${PROXY}" | tee -a /etc/cntlm.conf + for i in $(echo ${PROXY} | sed "s/;/ /g") + do + echo "Proxy ${i}" | tee -a /etc/cntlm.conf + echo "Setting Proxy ${i}" + done else echo "No proxy defined! Please set it using the variable \"PROXY\"." exit 1