Fix header argument

This commit is contained in:
Jonathan Curran 2020-06-09 15:42:07 -06:00
commit 9e969ba5d4

View file

@ -340,13 +340,13 @@ do_download () {
echo "Downloading ${url}..." echo "Downloading ${url}..."
local header local header
if [[ -n "${RS_USER_AGENT}" ]]; then if [[ -n "${RS_USER_AGENT}" ]]; then
header="--header 'User-Agent: ${RS_USER_AGENT}'" header="--header='User-Agent: ${RS_USER_AGENT}'"
fi fi
if [[ "${RUN_UNATTENDED}" -ne "0" ]]; then if [[ "${RUN_UNATTENDED}" -ne "0" ]]; then
wget -q "${header}" "${url}" wget -q "${header[@]}" "${url}"
else else
wget --progress=bar "${header}" "${url}" wget --progress=bar "${header[@]}" "${url}"
fi fi
rc=$? rc=$?
# Or, If curl is around, use that. # Or, If curl is around, use that.
@ -358,9 +358,9 @@ do_download () {
fi fi
if [[ "${RUN_UNATTENDED}" -ne "0" ]]; then if [[ "${RUN_UNATTENDED}" -ne "0" ]]; then
curl -fsSL "${header}" --output "${file_name}" "${url}" curl -fsSL "${header[@]}" --output "${file_name}" "${url}"
else else
curl -fL "${header}" --output "${file_name}" --progress-bar "${url}" curl -fsSL "${header[@]}" --output "${file_name}" --progress-bar "${url}"
fi fi
rc=$? rc=$?
# Otherwise, we can't go on. # Otherwise, we can't go on.