Skip to content

Commit 0d8d211

Browse files
committed
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
1 parent 372db24 commit 0d8d211

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

init/30_update_plex.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,20 @@ INSTALLED=$(dpkg-query -W -f='${Version}' plexmediaserver)
1414
#Get stuff from things.
1515
PLEX_TOKEN=$( sed -n 's/.*PlexOnlineToken="//p' "/config/Library/Application Support/Plex Media Server/Preferences.xml" | sed "s/\".*//")
1616
[ -z "$PLEX_TOKEN" ] && echo "Plex token not avalible, please login " && exit 0
17-
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 )
1817

1918
[ "$PLEXPASS" ] && echo "PLEXPASS is deprecated, please use VERSION"
2019
if [[ -z $VERSION && "$PLEXPASS" == "1" || $VERSION = "plexpass" ]]; then echo "VERSION=plexpass is depricated please use version latest"; fi
2120

22-
21+
v
2322
#Start update rutine
2423

2524

2625
if [[ "$VERSION" = latest || "$VERSION" = plexpass ]]; then
27-
VERSION=$PLEX_LATEST
26+
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 )
2827
echo "Target version: $VERSION set by: latest\plexpass"
28+
elif [[ "$VERSION" = public ]]; then
29+
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 )
30+
echo "Target version: $VERSION set by: public"
2931
elif [[ -z "$VERSION" ]]; then
3032
echo "Target version: Version not set, Defaulting to supplied version"
3133
else

0 commit comments

Comments
 (0)