mirror of
https://github.com/mrworf/plexupdate.git
synced 2025-08-19 12:59:40 -07:00
Better error handling for wget show-progress
This commit is contained in:
parent
5fc9e27b77
commit
144989e9c3
1 changed files with 5 additions and 7 deletions
|
@ -322,7 +322,11 @@ if [ "${SAVECONFIG}" = "yes" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${SHOWPROGRESS}" = "yes" ]; then
|
if [ "${SHOWPROGRESS}" = "yes" ]; then
|
||||||
WGETOPTIONS="--show-progress"
|
if ! wget --show-progress -V &>/dev/null; then
|
||||||
|
warn "Your wget is too old to support --show-progress, ignoring"
|
||||||
|
else
|
||||||
|
WGETOPTIONS="--show-progress"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${IGNOREAUTOUPDATE}" = "yes" ]; then
|
if [ "${IGNOREAUTOUPDATE}" = "yes" ]; then
|
||||||
|
@ -613,12 +617,6 @@ if [ "${SKIP_DOWNLOAD}" = "no" ]; then
|
||||||
info "Downloading release \"${FILENAME}\""
|
info "Downloading release \"${FILENAME}\""
|
||||||
wget ${WGETOPTIONS} -o "${FILE_WGETLOG}" --load-cookies "${FILE_KAKA}" --save-cookies "${FILE_KAKA}" --keep-session-cookies "${DOWNLOAD}" -O "${DOWNLOADDIR}/${FILENAME}" 2>&1
|
wget ${WGETOPTIONS} -o "${FILE_WGETLOG}" --load-cookies "${FILE_KAKA}" --save-cookies "${FILE_KAKA}" --keep-session-cookies "${DOWNLOAD}" -O "${DOWNLOADDIR}/${FILENAME}" 2>&1
|
||||||
CODE=$?
|
CODE=$?
|
||||||
if [ ${CODE} -eq 2 ]; then
|
|
||||||
error "Your wget is too old to support --show-progress"
|
|
||||||
info "Trying to download release \"${FILENAME}\" again"
|
|
||||||
wget -o "${FILE_WGETLOG}" --load-cookies "${FILE_KAKA}" --save-cookies "${FILE_KAKA}" --keep-session-cookies "${DOWNLOAD}" -O "${DOWNLOADDIR}/${FILENAME}" 2>&1
|
|
||||||
CODE=$?
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ${CODE} -ne 0 ]; then
|
if [ ${CODE} -ne 0 ]; then
|
||||||
error "Download failed with code ${CODE}:"
|
error "Download failed with code ${CODE}:"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue