From 93cb257b709bb16df84117373620c954f10758d7 Mon Sep 17 00:00:00 2001 From: James Bunton Date: Sun, 30 Mar 2008 21:37:56 +1100 Subject: [PATCH] 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 --- proxyconf.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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" -- 2.39.2