Added subversion config.
[profile.git] / .profile.d / proxy.bashrc
1 # $Id$
2 # Read proxy information from Subversion if possible.
3
4 servers=~/.subversion/servers
5
6 if [ -r "$servers" ]; then
7   eval $(sed -n '/^\[global\]/,/^\[/s/^http-proxy-\([^= ]*\) *= *\(.*\)/proxy_\1="\2"/p' "$servers")
8   creds=""
9   [ ! -z "$proxy_username" ] && creds="$proxy_username:$proxy_password@"
10   export http_proxy="http://$creds$proxy_host:${proxy_port:-80}"
11 fi
12
13 unset proxy_username proxy_password proxy_host proxy_port creds servers