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,8 +322,12 @@ if [ "${SAVECONFIG}" = "yes" ]; then
|
|||
fi
|
||||
|
||||
if [ "${SHOWPROGRESS}" = "yes" ]; then
|
||||
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
|
||||
|
||||
if [ "${IGNOREAUTOUPDATE}" = "yes" ]; then
|
||||
AUTOUPDATE=no
|
||||
|
@ -613,12 +617,6 @@ if [ "${SKIP_DOWNLOAD}" = "no" ]; then
|
|||
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
|
||||
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
|
||||
error "Download failed with code ${CODE}:"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue