X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=.profile.d%2Fproxy.bashrc;h=ecf56ae35323e31f5c9fa8d7495c52a6446efeaf;hb=31189bc241721bf1e1b38dd31875fa6093b64e74;hp=811fcbdb632083287dbcf8e06f2011c9c8e328e1;hpb=3638b2ac8e2e40888dae60233cc85f46de037acd;p=profile.git diff --git a/.profile.d/proxy.bashrc b/.profile.d/proxy.bashrc index 811fcbd..ecf56ae 100644 --- a/.profile.d/proxy.bashrc +++ b/.profile.d/proxy.bashrc @@ -3,11 +3,13 @@ servers=~/.subversion/servers -if [ -r "$servers" ]; then +if [ -O "$servers" ]; then eval $(sed -n '/^\[global\]/,/^\[/s/^http-proxy-\([^= ]*\) *= *\(.*\)/proxy_\1="\2"/p' "$servers") creds="" - [ ! -z "$proxy_username" ] && creds="$proxy_username:$proxy_password@" - export http_proxy="http://$creds$proxy_host:${proxy_port:-80}" + if [ ! -z "$proxy_host" ]; then + [ ! -z "$proxy_username" ] && creds="$proxy_username:$proxy_password@" + export http_proxy="http://$creds$proxy_host:${proxy_port:-80}" + fi fi unset proxy_username proxy_password proxy_host proxy_port creds servers