From: James Bunton Date: Sun, 30 Mar 2008 10:37:56 +0000 (+1100) Subject: Removed unneeded code X-Git-Url: https://code.delx.au/osx-proxyconf/commitdiff_plain/93cb257b709bb16df84117373620c954f10758d7?ds=sidebyside Removed unneeded code * sysconfig now outputs in the format we want, comma separated :) * Not sure what PROXY_FOUND was for, but things work fine without it --- diff --git a/proxyconf.sh b/proxyconf.sh index 262dfc8..a2583a6 100755 --- a/proxyconf.sh +++ b/proxyconf.sh @@ -1,6 +1,5 @@ #!/bin/bash -PROXY_FOUND=0 function printEnvironment() { local proxy_type="$1" local environment_variable="$2" @@ -11,8 +10,6 @@ function printEnvironment() { host="$(sysconfig -q "${proxy_type}Proxy")" port="$(sysconfig -q "${proxy_type}Port")" echo "export ${environment_variable}='${uri_prefix}://${host}:${port}'" - - PROXY_FOUND=1 else echo "unset ${environment_variable}" fi @@ -23,8 +20,8 @@ printEnvironment "HTTPS" "https_proxy" printEnvironment "FTP" "ftp_proxy" printEnvironment "SOCKS" "socks_proxy" "socks" -no_proxy="$(sysconfig -q ExceptionsList | tr '\n' ',' | sed 's/,$//g')" -if [ ! -z "${no_proxy}" ] && [ $PROXY_FOUND -ne 0 ]; then +no_proxy="$(sysconfig -q ExceptionsList)" +if [ ! -z "${no_proxy}" ]; then echo "export no_proxy=\"${no_proxy}\"" else echo "unset no_proxy"