Fix NO_PROXY var in docker-proxy script
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user