From 2d5cc7554431987d62ef58b62f19b56debb844ac Mon Sep 17 00:00:00 2001 From: Erik Alexandre Pucci <eap08@c3sl.ufpr.br> Date: Sun, 17 Apr 2011 20:24:43 -0300 Subject: [PATCH] common.sh: Added and edited code commentaries Signed-off-by: Erik Alexandre Pucci <eap08@c3sl.ufpr.br> Signed-off-by: Danilo K. S. Yorinori <danilok@c3sl.ufpr.br> --- common.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/common.sh b/common.sh index 699b9ca..b7c5650 100644 --- a/common.sh +++ b/common.sh @@ -21,21 +21,24 @@ #------------------------------------------------------------------------------ -# function: getProxyConf +# Function: getProxyConf # Load the proxy configuration. function getProxyConf() { + # Use collect variable, if defined. Otherwise use the client one if ! test -z "${PREFIX}"; then PROXYCONF="${PREFIX}/client/conf/proxy" else PROXYCONF="${dirname}/conf/proxy" fi + # Obtain proxy configuration by reading the proxy file phost=$(grep "^phost=" ${PROXYCONF} | cut -f2 -d=) pport=$(grep "^pport=" ${PROXYCONF} | cut -f2 -d=) puid=$(grep "^puid=" ${PROXYCONF} | cut -f2 -d=) ppasswd=$(grep "^ppasswd=" ${PROXYCONF} | cut -f2 -d=) + # Add a prefix to each non empty proxy information test -n "${phost}" && phost="--phost=${phost}" test -n "${pport}" && pport="--pport=${pport}" test -n "${puid}" && puid="--puid=${puid}" @@ -64,7 +67,7 @@ function tryWget(){ } #------------------------------------------------------------------------------ -# function: getNetworkInterface +# Function: getNetworkInterface # Get the network interface which the client must bind to (in case there is # more than one default route) and the collect will use to obtain the MAC # address. -- GitLab