|
|
@ -54,10 +54,10 @@ INSTALLED=$(dpkg-query -W -f='${Version}' plexmediaserver)
|
|
|
|
if [[ -z $VERSION && "$PLEXPASS" == "1" || $VERSION = "plexpass" ]]; then echo "VERSION=plexpass is depricated please use version latest"; fi
|
|
|
|
if [[ -z $VERSION && "$PLEXPASS" == "1" || $VERSION = "plexpass" ]]; then echo "VERSION=plexpass is depricated please use version latest"; fi
|
|
|
|
|
|
|
|
|
|
|
|
if [[ "$VERSION" = latest || "$VERSION" = plexpass ]]; then
|
|
|
|
if [[ "$VERSION" = latest || "$VERSION" = plexpass ]]; then
|
|
|
|
VERSION=$(curl -s "https://plex.tv/downloads/latest/1?channel=8&build=linux-ubuntu-x86_64&distro=ubuntu&X-Plex-Token=$PLEX_TOKEN"| cut -d "/" -f 5 )
|
|
|
|
VERSION=$(curl -s "${PLEX_URL}/latest/1?channel=8&build=linux-ubuntu-x86_64&distro=ubuntu&X-Plex-Token=$PLEX_TOKEN"| cut -d "/" -f 5 )
|
|
|
|
echo "Target version: $VERSION set by: latest\plexpass"
|
|
|
|
echo "Target version: $VERSION set by: latest\plexpass"
|
|
|
|
elif [[ "$VERSION" = public ]]; then
|
|
|
|
elif [[ "$VERSION" = public ]]; then
|
|
|
|
VERSION=$(curl -s "https://plex.tv/downloads/latest/1?channel=8&build=linux-ubuntu-x86_64&distro=ubuntu&X-Plex-Token="| cut -d "/" -f 5 )
|
|
|
|
VERSION=$(curl -s "${PLEX_URL}/latest/1?channel=8&build=linux-ubuntu-x86_64&distro=ubuntu&X-Plex-Token="| cut -d "/" -f 5 )
|
|
|
|
echo "Target version: $VERSION set by: public"
|
|
|
|
echo "Target version: $VERSION set by: public"
|
|
|
|
elif [[ -z "$VERSION" ]]; then
|
|
|
|
elif [[ -z "$VERSION" ]]; then
|
|
|
|
echo "Target version: Version not set, Defaulting to supplied version"
|
|
|
|
echo "Target version: Version not set, Defaulting to supplied version"
|
|
|
@ -72,7 +72,8 @@ elif [[ "$VERSION" != "$INSTALLED" ]]; then
|
|
|
|
echo "Upgrading from version: $INSTALLED to version: $VERSION"
|
|
|
|
echo "Upgrading from version: $INSTALLED to version: $VERSION"
|
|
|
|
while [[ $last -ne "0" ]]; do
|
|
|
|
while [[ $last -ne "0" ]]; do
|
|
|
|
rm -f /tmp/plexmediaserver_*.deb
|
|
|
|
rm -f /tmp/plexmediaserver_*.deb
|
|
|
|
wget -P /tmp "https://downloads.plex.tv/plex-media-server/$VERSION/plexmediaserver_${VERSION}_amd64.deb"
|
|
|
|
curl -o /tmp/plexmediaserver_"${VERSION}"_amd64.deb -L \
|
|
|
|
|
|
|
|
"${PLEX_URL}/plex-media-server/$VERSION/plexmediaserver_${VERSION}_amd64.deb"
|
|
|
|
last=$?
|
|
|
|
last=$?
|
|
|
|
done
|
|
|
|
done
|
|
|
|
[[ ! -e /tmp/plexmediaserver_"${VERSION}"_amd64.deb ]] && exit 0
|
|
|
|
[[ ! -e /tmp/plexmediaserver_"${VERSION}"_amd64.deb ]] && exit 0
|
|
|
|