diff --git a/common.sh b/common.sh index 699b9ca814722ef3fb5888188b6ac6be3919acf5..b7c56500ec6ed7d7ccec26221db5ea9995227db2 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.