Clearly log failed update if remote version can't be fetched

pull/374/head
TheSpad 1 year ago
parent a8f529c0e2
commit 2921a3e2a0
No known key found for this signature in database
GPG Key ID: 08F06191F4587860

@ -100,7 +100,7 @@ if [[ "${VERSION,,}" = latest ]] || [[ "${VERSION,,}" = plexpass ]] || [[ "$PLEX
fi fi
REMOTE_VERSION=$(curl -s "https://plex.tv/downloads/details/5?distro=debian&build=linux-${PLEX_URL_ARCH}&channel=8&X-Plex-Token=$PLEX_TOKEN"| grep -oP 'version="\K[^"]+' | tail -n 1 ) REMOTE_VERSION=$(curl -s "https://plex.tv/downloads/details/5?distro=debian&build=linux-${PLEX_URL_ARCH}&channel=8&X-Plex-Token=$PLEX_TOKEN"| grep -oP 'version="\K[^"]+' | tail -n 1 )
elif [[ "${VERSION,,}" = public ]]; then elif [[ "${VERSION,,}" = public ]]; then
REMOTE_VERSION=$(curl -sX GET 'https://plex.tv/api/downloads/5.json' | jq -r '.computer.Linux.version') REMOTE_VERSION=$(curl -s 'https://plex.tv/api/downloads/5.json' | jq -r '.computer.Linux.version')
else else
REMOTE_VERSION="${VERSION}" REMOTE_VERSION="${VERSION}"
fi fi
@ -110,6 +110,11 @@ if [[ "$REMOTE_VERSION" == "$INSTALLED_VERSION" ]]; then
exit 0 exit 0
fi fi
if [[ -z "${REMOTE_VERSION}" ]]; then
echo "*** Unable to fetch version from Plex remote endpoint, please check your network configuration ***"
exit 0
fi
echo "Atempting to upgrade to: $REMOTE_VERSION" echo "Atempting to upgrade to: $REMOTE_VERSION"
rm -f /tmp/plexmediaserver_*.deb rm -f /tmp/plexmediaserver_*.deb
wget -nv -P /tmp \ wget -nv -P /tmp \

Loading…
Cancel
Save