Check if wget fails due to unsupported options

--show-progress will not stop plexupdate.sh but it will tell you
it didn't like it very much. You need wget 1.16+ for that to work.

Fixes #123
This commit is contained in:
Henric Andersson 2016-11-10 17:19:10 -08:00
commit cb30231fac

View file

@ -766,6 +766,13 @@ if [ "${SKIP_DOWNLOAD}" = "no" ]; then
infoLogNoNewline "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
errorLog "!! Your wget is too old to support --show-progress"
infoLogNoNewline "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
ERROR=$(cat ${FILE_WGETLOG})
if [ ${CODE} -ne 0 ]; then
errorLog "!! Download failed with code ${CODE}, \"${ERROR}\""