From 2921a3e2a0067bb784cc08cf6f24a4a476c7f233 Mon Sep 17 00:00:00 2001 From: TheSpad Date: Mon, 4 Sep 2023 20:23:00 +0100 Subject: [PATCH 1/2] Clearly log failed update if remote version can't be fetched --- root/etc/s6-overlay/s6-rc.d/init-plex-update/run | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/root/etc/s6-overlay/s6-rc.d/init-plex-update/run b/root/etc/s6-overlay/s6-rc.d/init-plex-update/run index 6e0cf633..c22df28b 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-plex-update/run +++ b/root/etc/s6-overlay/s6-rc.d/init-plex-update/run @@ -100,7 +100,7 @@ if [[ "${VERSION,,}" = latest ]] || [[ "${VERSION,,}" = plexpass ]] || [[ "$PLEX 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 ) 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 REMOTE_VERSION="${VERSION}" fi @@ -110,6 +110,11 @@ if [[ "$REMOTE_VERSION" == "$INSTALLED_VERSION" ]]; then exit 0 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" rm -f /tmp/plexmediaserver_*.deb wget -nv -P /tmp \ From b804392aaa9823d428665888fffd6bd15c08b916 Mon Sep 17 00:00:00 2001 From: TheSpad Date: Mon, 4 Sep 2023 20:26:16 +0100 Subject: [PATCH 2/2] Clarify --- root/etc/s6-overlay/s6-rc.d/init-plex-update/run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/root/etc/s6-overlay/s6-rc.d/init-plex-update/run b/root/etc/s6-overlay/s6-rc.d/init-plex-update/run index c22df28b..6f1751dd 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-plex-update/run +++ b/root/etc/s6-overlay/s6-rc.d/init-plex-update/run @@ -111,7 +111,7 @@ if [[ "$REMOTE_VERSION" == "$INSTALLED_VERSION" ]]; then fi if [[ -z "${REMOTE_VERSION}" ]]; then - echo "*** Unable to fetch version from Plex remote endpoint, please check your network configuration ***" + echo "*** Unable to fetch version from Plex remote endpoint or empty VERSION supplied, please check your configuration ***" exit 0 fi