Fix NO_PROXY var in docker-proxy script

This commit is contained in:
TKE
2021-08-19 14:42:41 +02:00
parent 6567af338d
commit bdfe047a33

View File

@@ -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 "[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="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 '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 restart_docker