Skip to content

Commit

Permalink
use http proxy for https when asked
Browse files Browse the repository at this point in the history
  • Loading branch information
himanshub16 committed Jan 21, 2019
1 parent da5c99b commit d2e34c1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,14 @@ set_proxy() {
stmt="${username}:${password}@"
fi

echo 'Environment="HTTP_PROXY=http://'${stmt}${http_host}:${http_port}'/" "HTTPS_PROXY=http://'${stmt}${https_host}:${https_port}'/" "NO_PROXY='${no_proxy}'"'\
>> $CONF_FILE
if [ "$USE_HTTP_PROXY_FOR_HTTPS" = "true" ]; then
echo 'Environment="HTTP_PROXY=http://'${stmt}${http_host}:${http_port}'/" "HTTPS_PROXY=http://'${stmt}${https_host}:${https_port}'/" "NO_PROXY='${no_proxy}'"'\
>> $CONF_FILE
else
echo 'Environment="HTTP_PROXY=http://'${stmt}${http_host}:${http_port}'/" "HTTPS_PROXY=https://'${stmt}${https_host}:${https_port}'/" "NO_PROXY='${no_proxy}'"'\
>> $CONF_FILE
fi


return
}
Expand Down
4 changes: 2 additions & 2 deletions shellrc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ set_proxy() {
echo "export NO_PROXY=\"${no_proxy}"\" >> "$SHELLRC"

if [ "$USE_HTTP_PROXY_FOR_HTTPS" = "true" ]; then
echo "export https_proxy=$http_proxy" >> "$SHELLRC"
echo "export HTTPS_PROXY=$HTTP_PROXY" >> "$SHELLRC"
echo "export https_proxy=\"${http_proxy}/\"" >> "$SHELLRC"
echo "export HTTPS_PROXY=\"${HTTP_PROXY}/\"" >> "$SHELLRC"
else
echo "export https_proxy=\"https://${stmt}${https_host}:${https_port}/\"" >> "$SHELLRC"
echo "export HTTPS_PROXY=\"https://${stmt}${https_host}:${https_port}/\"" >> "$SHELLRC"
Expand Down

0 comments on commit d2e34c1

Please sign in to comment.