From 3d0d47316e69144bcd26a2614b82d0716c66be0e Mon Sep 17 00:00:00 2001
From: Erik Alexandre Pucci <eap08@c3sl.ufpr.br>
Date: Sun, 17 Apr 2011 20:24:44 -0300
Subject: [PATCH] common.sh: Added messages for proxy use and missing
 information case

The script will check if there's any proxy configuration and, if so, it will
print a message to log file. Besides that, it'll also check if the system
variable "http_proxy" has a value, thus logging "something is wrong".

Signed-off-by: Erik Alexandre Pucci <eap08@c3sl.ufpr.br>
Signed-off-by: Danilo K. S. Yorinori <danilok@c3sl.ufpr.br>
---
 common.sh | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/common.sh b/common.sh
index b7c5650..cc4262e 100644
--- a/common.sh
+++ b/common.sh
@@ -43,6 +43,16 @@ function getProxyConf()
     test -n "${pport}" && pport="--pport=${pport}"
     test -n "${puid}" && puid="--puid=${puid}"
     test -n "${ppasswd}" && ppasswd="--ppasswd=${ppasswd}"
+
+    # If there is any proxy information, add a message to log
+    if test -n "${phost}${pport}${puid}${ppasswd}"; then
+        printf "Proxy configuration being used.\n" >> ${log}
+        # If there is a valued system proxy variable, print a warning to log
+        if test -n "${http_proxy}"; then
+            printf "WARNING: The proxy file is " >> ${log}
+            printf "empty but http_proxy isn't.\n" >> ${log}
+        fi
+    fi
 }
 
 function tryWget(){
-- 
GitLab