Use default user-agent
This commit is contained in:
parent
2e5cfa7cd8
commit
40a8dc64fa
1 changed files with 4 additions and 13 deletions
17
install.sh
17
install.sh
|
|
@ -338,29 +338,20 @@ do_download () {
|
||||||
|
|
||||||
if [[ -z "${wget_rc}" ]]; then
|
if [[ -z "${wget_rc}" ]]; then
|
||||||
echo "Downloading ${url}..."
|
echo "Downloading ${url}..."
|
||||||
local header
|
|
||||||
if [[ -n "${RS_USER_AGENT}" ]]; then
|
|
||||||
header="--header='User-Agent: ${RS_USER_AGENT}'"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "${RUN_UNATTENDED}" -ne "0" ]]; then
|
if [[ "${RUN_UNATTENDED}" -ne "0" ]]; then
|
||||||
wget -q "${header[@]}" "${url}"
|
wget -q --header "User-Agent: ${RS_USER_AGENT:-r-builds}" "${url}"
|
||||||
else
|
else
|
||||||
wget --progress=bar "${header[@]}" "${url}"
|
wget --progress=bar --header "User-Agent: ${RS_USER_AGENT:-r-builds}" "${url}"
|
||||||
fi
|
fi
|
||||||
rc=$?
|
rc=$?
|
||||||
# Or, If curl is around, use that.
|
# Or, If curl is around, use that.
|
||||||
elif [[ -z "${curl_rc}" ]]; then
|
elif [[ -z "${curl_rc}" ]]; then
|
||||||
echo "Downloading ${url}..."
|
echo "Downloading ${url}..."
|
||||||
local header
|
|
||||||
if [[ -n "${RS_USER_AGENT}" ]]; then
|
|
||||||
header="-H 'User-Agent: ${RS_USER_AGENT}'"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "${RUN_UNATTENDED}" -ne "0" ]]; then
|
if [[ "${RUN_UNATTENDED}" -ne "0" ]]; then
|
||||||
curl -fsSL "${header[@]}" --output "${file_name}" "${url}"
|
curl -fsSL -H "User-Agent: ${RS_USER_AGENT:-r-builds}" --output "${file_name}" "${url}"
|
||||||
else
|
else
|
||||||
curl -fL "${header[@]}" --output "${file_name}" --progress-bar "${url}"
|
curl -fL -H "User-Agent: ${RS_USER_AGENT:-r-builds}" --output "${file_name}" --progress-bar "${url}"
|
||||||
fi
|
fi
|
||||||
rc=$?
|
rc=$?
|
||||||
# Otherwise, we can't go on.
|
# Otherwise, we can't go on.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue