diff --git a/proxy/update_docker_proxy.sh b/proxy/update_docker_proxy.sh index 6a18caf..560c6f8 100755 --- a/proxy/update_docker_proxy.sh +++ b/proxy/update_docker_proxy.sh @@ -30,6 +30,10 @@ encpassword=$(echo -n ${password} | xxd -p | sed -e 's/\(..\)/%%\1/g' ) echo "[Service]" | sudo tee /etc/systemd/system/docker.service.d/http-proxy.conf >/dev/null echo 'Environment="HTTP_PROXY=http://'"${username}"':"'"${encpassword}@${proxy_ip}:${proxy_port}/" | sudo tee -a /etc/systemd/system/docker.service.d/http-proxy.conf >/dev/null echo 'Environment="HTTPS_PROXY=http://'"${username}"':"'"${encpassword}@${proxy_ip}:${proxy_port}/" | sudo tee -a /etc/systemd/system/docker.service.d/http-proxy.conf >/dev/null -echo -n '"NO_PROXY=localhost,127.0.0.1"' | sudo tee -a /etc/systemd/system/docker.service.d/http-proxy.conf >/dev/null +if [[ -z "$NO_PROXY" ]] ; then + echo -n 'Environment="NO_PROXY=localhost,127.0.0.1"' | sudo tee -a /etc/systemd/system/docker.service.d/http-proxy.conf >/dev/null +else + echo 'Environment="'$(env | grep NO_PROXY)'"' | sudo tee -a /etc/systemd/system/docker.service.d/http-proxy.conf >/dev/null +fi restart_docker