Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Sep 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion root/etc/s6-overlay/s6-rc.d/init-plex-update/run
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 or empty VERSION supplied, please check your configuration ***"
exit 0
fi

echo "Atempting to upgrade to: $REMOTE_VERSION"
rm -f /tmp/plexmediaserver_*.deb
wget -nv -P /tmp \
Expand Down