Skip to content

Instantly share code, notes, and snippets.

@int128
Created June 5, 2012 07:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save int128/2873395 to your computer and use it in GitHub Desktop.
Save int128/2873395 to your computer and use it in GitHub Desktop.
http_proxy を対話的に設定する関数
# /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