Updated Download function.
This commit is contained in:
parent
93f5f9177a
commit
3da23b9432
@ -199,12 +199,12 @@ download() {
|
|||||||
dest="${dest#*\?filename=}"
|
dest="${dest#*\?filename=}"
|
||||||
dest="${dest%\?*}"
|
dest="${dest%\?*}"
|
||||||
# Remove the destination file if it is empty.
|
# Remove the destination file if it is empty.
|
||||||
test -s "${cache}/${dest}" || rm -f "${cache}/${dest}" 2> /dev/null
|
[[ -s "${cache}/${dest}" ]] || rm -f "${cache}/${dest}" 2> /dev/null
|
||||||
if [[ "${redownload}" == "true" ]] && [[ -e "${cache}/${dest}" ]]; then
|
if [[ "${redownload}" == "true" ]] && [[ -e "${cache}/${dest}" ]]; then
|
||||||
rm -v "${cache}/${dest}"
|
rm -v "${cache}/${dest}"
|
||||||
fi
|
fi
|
||||||
# Skip if the item is in cache.
|
# Skip if the item is in cache.
|
||||||
test -e "${cache}/${dest}" && continue
|
[[ -e "${cache}/${dest}" ]] && continue
|
||||||
{ if ! curl -L4 -C - --retry 10 --output "${cache}/${dest}" "${i}" ; then
|
{ if ! curl -L4 -C - --retry 10 --output "${cache}/${dest}" "${i}" ; then
|
||||||
echo "Could not download \"$i\"..."
|
echo "Could not download \"$i\"..."
|
||||||
exit 1
|
exit 1
|
||||||
|
Loading…
Reference in New Issue
Block a user