mirror of
https://gh.con.sh/https://github.com/plexinc/pms-docker
synced 2025-04-26 18:21:40 +00:00
Added overriding of update channel for internal testing purposes.
This commit is contained in:
parent
21664a6779
commit
8438f12d66
@ -6,16 +6,26 @@ function getVersionInfo {
|
||||
declare -n remoteVersion=$3
|
||||
declare -n remoteFile=$4
|
||||
|
||||
local versionInfo
|
||||
|
||||
if [ "${version,,}" = "plexpass" ]; then
|
||||
versionInfo="$(curl -s "https://plex.tv/downloads/details/1?build=linux-ubuntu-x86_64&channel=8&distro=ubuntu&X-Plex-Token=${token}")"
|
||||
local channel
|
||||
local tokenNeeded=1
|
||||
if [ ! -z "${PLEX_UPDATE_CHANNEL}" ] && [ "${PLEX_UPDATE_CHANNEL}" > 0 ]; then
|
||||
channel="${PLEX_UPDATE_CHANNEL}"
|
||||
elif [ "${version,,}" = "plexpass" ]; then
|
||||
channel=8
|
||||
elif [ "${version,,}" = "public" ]; then
|
||||
versionInfo="$(curl -s "https://plex.tv/downloads/details/1?build=linux-ubuntu-x86_64&channel=16&distro=ubuntu")"
|
||||
channel=16
|
||||
tokenNeeded=0
|
||||
else
|
||||
versionInfo="$(curl -s "https://plex.tv/downloads/details/1?build=linux-ubuntu-x86_64&channel=8&distro=ubuntu&X-Plex-Token=${token}&version=${version}")"
|
||||
channel=8
|
||||
fi
|
||||
|
||||
local url="https://plex.tv/downloads/details/1?build=linux-ubuntu-x86_64&channel=${channel}&distro=ubuntu"
|
||||
if [ ${tokenNeeded} -gt 0 ]; then
|
||||
url="${url}&X-Plex-Token=${token}"
|
||||
fi
|
||||
|
||||
local versionInfo="$(curl -s "${url}")"
|
||||
|
||||
# Get update info from the XML. Note: This could countain multiple updates when user specifies an exact version with the lowest first, so we'll use first always.
|
||||
remoteVersion=$(echo "${versionInfo}" | sed -n 's/.*Release.*version="\([^"]*\)".*/\1/p')
|
||||
remoteFile=$(echo "${versionInfo}" | sed -n 's/.*file="\([^"]*\)".*/\1/p')
|
||||
|
Loading…
x
Reference in New Issue
Block a user