From 36cb7efe89ad2c330f8809f3a5043d554682241d Mon Sep 17 00:00:00 2001 From: James Bunton Date: Sat, 28 Jul 2007 13:30:25 +1000 Subject: [PATCH] Also print out no_proxy environment variable --- proxyconf.sh | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/proxyconf.sh b/proxyconf.sh index 78b537c..261ffbe 100755 --- a/proxyconf.sh +++ b/proxyconf.sh @@ -1,17 +1,21 @@ #!/bin/bash -if [ "$(sysconfig "HTTPEnable")" -eq 1 ]; then - host="$(sysconfig "HTTPProxy")" - port="$(sysconfig "HTTPPort")" +if [ "$(sysconfig -q "HTTPEnable")" = "1" ]; then + host="$(sysconfig -q "HTTPProxy")" + port="$(sysconfig -q "HTTPPort")" echo "export http_proxy=\"http://${host}:${port}\"" fi -if [ "$(sysconfig "HTTPSEnable")" -eq 1 ]; then - host="$(sysconfig "HTTPSProxy")" - port="$(sysconfig "HTTPSPort")" +if [ "$(sysconfig -q "HTTPSEnable")" = "1" ]; then + host="$(sysconfig -q "HTTPSProxy")" + port="$(sysconfig -q "HTTPSPort")" echo "export https_proxy=\"http://${host}:${port}\"" fi -if [ "$(sysconfig "FTPEnable")" -eq 1 ]; then - host="$(sysconfig "FTPProxy")" - port="$(sysconfig "FTPPort")" +if [ "$(sysconfig -q "FTPEnable")" = "1" ]; then + host="$(sysconfig -q "FTPProxy")" + port="$(sysconfig -q "FTPPort")" echo "export ftp_proxy=\"http://${host}:${port}\"" fi +if [ -n "${host}" ]; then + no_proxy="$(sysconfig ExceptionsList | tr '\n' ',' | sed 's/,$//g')" + echo "export no_proxy=\"${no_proxy}\"" +fi -- 2.39.2