mirror of https://github.com/samply/bridgehead.git
Always define new vars
This commit is contained in:
parent
f008b18760
commit
bbfc607104
|
@ -16,15 +16,14 @@ setupProxy() {
|
||||||
local http="no"
|
local http="no"
|
||||||
local https="no"
|
local https="no"
|
||||||
if [ $HTTPS_PROXY_URL ]; then
|
if [ $HTTPS_PROXY_URL ]; then
|
||||||
|
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')"
|
||||||
if [[ ! -z "$HTTPS_PROXY_USERNAME" && ! -z "$HTTPS_PROXY_PASSWORD" ]]; then
|
if [[ ! -z "$HTTPS_PROXY_USERNAME" && ! -z "$HTTPS_PROXY_PASSWORD" ]]; then
|
||||||
local proto="$(echo $HTTPS_PROXY_URL | grep :// | sed -e's,^\(.*://\).*,\1,g')"
|
local proto="$(echo $HTTPS_PROXY_URL | grep :// | sed -e's,^\(.*://\).*,\1,g')"
|
||||||
local fqdn="$(echo ${HTTPS_PROXY_URL/$proto/})"
|
local fqdn="$(echo ${HTTPS_PROXY_URL/$proto/})"
|
||||||
HTTPS_PROXY_FULL_URL="$(echo $proto$HTTPS_PROXY_USERNAME:$HTTPS_PROXY_PASSWORD@$fqdn)"
|
HTTPS_PROXY_FULL_URL="$(echo $proto$HTTPS_PROXY_USERNAME:$HTTPS_PROXY_PASSWORD@$fqdn)"
|
||||||
|
|
||||||
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')"
|
|
||||||
|
|
||||||
https="authenticated"
|
https="authenticated"
|
||||||
else
|
else
|
||||||
HTTPS_PROXY_FULL_URL=$HTTPS_PROXY_URL
|
HTTPS_PROXY_FULL_URL=$HTTPS_PROXY_URL
|
||||||
|
|
Loading…
Reference in New Issue