Skip to content

Commit 631c4f1

Browse files
authored
Merge pull request #374 from linuxserver/error-handling
2 parents a8f529c + b804392 commit 631c4f1

File tree

1 file changed

+6
-1
lines changed
  • root/etc/s6-overlay/s6-rc.d/init-plex-update

1 file changed

+6
-1
lines changed

root/etc/s6-overlay/s6-rc.d/init-plex-update/run

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ if [[ "${VERSION,,}" = latest ]] || [[ "${VERSION,,}" = plexpass ]] || [[ "$PLEX
100100
fi
101101
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 )
102102
elif [[ "${VERSION,,}" = public ]]; then
103-
REMOTE_VERSION=$(curl -sX GET 'https://plex.tv/api/downloads/5.json' | jq -r '.computer.Linux.version')
103+
REMOTE_VERSION=$(curl -s 'https://plex.tv/api/downloads/5.json' | jq -r '.computer.Linux.version')
104104
else
105105
REMOTE_VERSION="${VERSION}"
106106
fi
@@ -110,6 +110,11 @@ if [[ "$REMOTE_VERSION" == "$INSTALLED_VERSION" ]]; then
110110
exit 0
111111
fi
112112

113+
if [[ -z "${REMOTE_VERSION}" ]]; then
114+
echo "*** Unable to fetch version from Plex remote endpoint or empty VERSION supplied, please check your configuration ***"
115+
exit 0
116+
fi
117+
113118
echo "Atempting to upgrade to: $REMOTE_VERSION"
114119
rm -f /tmp/plexmediaserver_*.deb
115120
wget -nv -P /tmp \

0 commit comments

Comments
 (0)