if [ -r "$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