Skip to content
Snippets Groups Projects
Commit 747eab0a authored by Vinicius Ruoso's avatar Vinicius Ruoso Committed by Danilo K. S. Yorinori
Browse files

Created tryWget() to allow the easy use of the package wget(1)


This function will retrieve the proxy configuration and call the appropriate
wget(1), i.e. the system wget(1) if available, or the package wget(1).

Also, it will be easier to call wget(1) in any script of the package.

Signed-off-by: default avatarVinicius Ruoso <vkr07@c3sl.ufpr.br>
Acked-by: default avatarErik Alexandre Pucci <eap08@c3sl.ufpr.br>
Acked-by: default avatarDiego Giovane Pasqualin <dgp06@c3sl.ufpr.br>
Signed-off-by: default avatarDanilo K. S. Yorinori <danilok@c3sl.ufpr.br>
parent 04abd0ef
No related branches found
No related tags found
No related merge requests found
......@@ -36,3 +36,24 @@ function getProxyConf()
puid=$(grep "^puid=" ${PROXYCONF} | cut -f2 -d=)
ppasswd=$(grep "^ppasswd=" ${PROXYCONF} | cut -f2 -d=)
}
function tryWget(){
getProxyConf
if test -z "$phost"; then
PROXY=""
else
PROXY="http://${phost}:${pport}"
fi
if which wget &>/dev/null; then
WGETBIN="$(which wget)"
else
WGETBIN="${PREFIX}/bin/wget"
fi
http_proxy="${PROXY}" ${WGETBIN} --tries=${UPDATETRIES} \
--timeout=${UPDATETIMEOUT} \
--proxy-user="${puid}" \
--proxy-password="${ppasswd}" \
$* || return 1
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment