Skip to content

Instantly share code, notes, and snippets.

@janosgyerik
Created June 18, 2013 15:41
Show Gist options
  • Select an option

  • Save janosgyerik/5806456 to your computer and use it in GitHub Desktop.

Select an option

Save janosgyerik/5806456 to your computer and use it in GitHub Desktop.
# usage: PW=the_pw . ~/scripts/proxy.sh"
# edit this depending on your environment
template='http://USERNAME:$PW@PROXYURL:PROXYPORT'
if test "$PW"; then
clear
echo "* note: cleared the screen for your safety"
echo "* using proxy address template: $template"
proxy_address=$(eval echo $template)
export http_proxy=$proxy_address
echo "* updated http_proxy using the template and PW"
export https_proxy=$proxy_address
echo "* updated https_proxy using the template and PW"
HISTFILE_saved=$HISTFILE
HISTFILE=
echo "* unset HISTFILE for your safety, saved its old value in HISTFILE_save
d"
else
echo "# usage: PW=the_pw . ~/scripts/proxy.sh"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment