From 0d8d2114a66c197b7f47f52d59f9529e81ed89d2 Mon Sep 17 00:00:00 2001 From: Stian Buch Larsen Date: Thu, 19 May 2016 22:37:32 +0200 Subject: [PATCH] Adds the posibility of useing VERSION=public to disable any update to a plexpass version, for anyone entitled to it. (#35) * Adds the posibility of useing VERSION=public to disable any update to a plexpass version, for anyone entitled to it. * CRLF to LF --- init/30_update_plex.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/init/30_update_plex.sh b/init/30_update_plex.sh index 6239ad7..d7d86e3 100644 --- a/init/30_update_plex.sh +++ b/init/30_update_plex.sh @@ -14,18 +14,20 @@ INSTALLED=$(dpkg-query -W -f='${Version}' plexmediaserver) #Get stuff from things. PLEX_TOKEN=$( sed -n 's/.*PlexOnlineToken="//p' "/config/Library/Application Support/Plex Media Server/Preferences.xml" | sed "s/\".*//") [ -z "$PLEX_TOKEN" ] && echo "Plex token not avalible, please login " && exit 0 -PLEX_LATEST=$(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 ) [ "$PLEXPASS" ] && echo "PLEXPASS is deprecated, please use VERSION" if [[ -z $VERSION && "$PLEXPASS" == "1" || $VERSION = "plexpass" ]]; then echo "VERSION=plexpass is depricated please use version latest"; fi - +v #Start update rutine if [[ "$VERSION" = latest || "$VERSION" = plexpass ]]; then - VERSION=$PLEX_LATEST + 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 ) echo "Target version: $VERSION set by: latest\plexpass" +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 ) + echo "Target version: $VERSION set by: public" elif [[ -z "$VERSION" ]]; then echo "Target version: Version not set, Defaulting to supplied version" else