Created
June 5, 2012 07:50
-
-
Save int128/2873395 to your computer and use it in GitHub Desktop.
http_proxy を対話的に設定する関数
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
# /etc/profile.d/setproxy.sh | |
function setproxy () { | |
proxy_uri='proxy.example.com:8080' | |
echo "Proxy URI: ${proxy_uri}" | |
echo -n 'Proxy user: ' | |
read -s proxy_id | |
echo | |
echo -n 'Proxy password: ' | |
read -s proxy_pw | |
echo | |
export http_proxy="http://${proxy_id}:${proxy_pw}@${proxy_uri}" | |
echo 'Examining connection...' | |
curl -I http://www.example.com/ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment