From 392afb6410d10fa77db554051bde18fe87ca83a3 Mon Sep 17 00:00:00 2001 From: lablans Date: Tue, 24 Oct 2023 07:23:24 +0000 Subject: [PATCH] Fix code --- lib/functions.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/functions.sh b/lib/functions.sh index 2e6a144..4d2bb2f 100644 --- a/lib/functions.sh +++ b/lib/functions.sh @@ -16,6 +16,8 @@ setupProxy() { local http="no" local https="no" if [ $HTTPS_PROXY_URL ]; then + local proto="$(echo $HTTPS_PROXY_URL | grep :// | sed -e 's,^\(.*://\).*,\1,g')" + local fqdn="$(echo ${HTTPS_PROXY_URL/$proto/})" local hostport=$(echo $HTTPS_PROXY_URL | sed -e "s,$proto,,g" | cut -d/ -f1) HTTPS_PROXY_HOST="$(echo $hostport | sed -e 's,:.*,,g')" HTTPS_PROXY_PORT="$(echo $hostport | sed -e 's,^.*:,:,g' -e 's,.*:\([0-9]*\).*,\1,g' -e 's,[^0-9],,g')" @@ -23,7 +25,6 @@ setupProxy() { local proto="$(echo $HTTPS_PROXY_URL | grep :// | sed -e 's,^\(.*://\).*,\1,g')" local fqdn="$(echo ${HTTPS_PROXY_URL/$proto/})" HTTPS_PROXY_FULL_URL="$(echo $proto$HTTPS_PROXY_USERNAME:$HTTPS_PROXY_PASSWORD@$fqdn)" - https="authenticated" else HTTPS_PROXY_FULL_URL=$HTTPS_PROXY_URL @@ -32,6 +33,7 @@ setupProxy() { fi log INFO "Configuring proxy servers: $http http proxy (we're not supporting unencrypted comms), $https https proxy" + export HTTPS_PROXY_HOST HTTPS_PROXY_PORT HTTPS_PROXY_FULL_URL } exitIfNotRoot() {