Last active
April 9, 2018 14:50
-
-
Save igorferreira/ecd3aa588e56fe62aef2f1e13de6e80c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "config: git config proxy..." | |
git config --global http.proxy 127.0.0.1:3128 | |
git config --global https.proxy 127.0.0.1:3128 | |
echo "config: yum proxy..." | |
sudo sed -i 's/#proxy=http:\/\/127.0.0.1:3128/proxy=http:\/\/127.0.0.1:3128/g' /etc/yum.conf | |
echo "restart cntlm..." | |
sudo service cntlm restart | |
echo "config: docker server proxy..." | |
$meu-sub-dominio="novedade.br" | |
file="/etc/systemd/system/docker.service.d/http-proxy.conf.bkp" | |
if [ -f "$file" ] | |
then | |
echo "$file found." | |
sudo mv /etc/systemd/system/docker.service.d/http-proxy.conf.bkp /etc/systemd/system/docker.service.d/http-proxy.conf | |
else | |
echo "$file not found." | |
sudo echo $'\n [Service] \n Environment="HTTP_PROXY=http://127.0.0.1:3128" "NO_PROXY=localhost,127.0.0.1,*.$meu-sub-dominio" \n' > /etc/systemd/system/docker.service.d/http-proxy.conf | |
echo "print $file" | |
echo /etc/systemd/system/docker.service.d/http-proxy.conf | |
fi | |
file="/etc/systemd/system/docker.service.d/https-proxy.conf.bkp" | |
if [ -f "$file" ] | |
then | |
echo "$file found then reload backupt" | |
sudo mv /etc/systemd/system/docker.service.d/https-proxy.conf.bkp /etc/systemd/system/docker.service.d/https-proxy.conf | |
else | |
echo "$file not found then creating..." | |
sudo echo $'\n [Service] \n Environment="HTTPS_PROXY=https://127.0.0.1:3128" "NO_PROXY=localhost,127.0.0.1,*.$meu-sub-dominio" \n' > /etc/systemd/system/docker.service.d/http-proxy.conf | |
echo "print $file" | |
echo /etc/systemd/system/docker.service.d/https-proxy.conf | |
fi | |
sudo systemctl daemon-reload | |
sudo systemctl restart docker |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment