Skip to content

Commit 4e5532d

Browse files
committed
Initial work on alter the update rutine
Removes lots of old code, replaceing with new token based authentication.
1 parent ae5da8f commit 4e5532d

1 file changed

Lines changed: 18 additions & 6 deletions

File tree

init/30_update_plex.sh

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,29 @@ while ! ping -c1 tools.linuxserver.io &>/dev/null; do :; done
1010
#The following error is not an error.
1111
INSTALLED=$(dpkg-query -W -f='${Version}' plexmediaserver)
1212

13+
14+
#Get stuff from things.
15+
PLEX_TOKEN=$()
16+
[ -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 )
18+
1319
[ "$PLEXPASS" ] && echo "PLEXPASS is deprecated, please use VERSION"
20+
if [[ -z $VERSION && "$PLEXPASS" == "1" || $VERSION = "plexpass" ]]; then echo "VERSION=plexpass is depricated please use version latest"; fi
21+
22+
23+
#Start update rutine
1424

15-
if [[ -z $VERSION && "$PLEXPASS" == "1" || $VERSION = "plexpass" ]]; then
16-
echo "Usage of VERSION=PLEXPASS is depricated. latest\plexpass is automatic based upon your plex account."
17-
elif [[ $VERSION = "latest" || -z $VERSION ]]; then
18-
VERSION=$(curl -s https://tools.linuxserver.io/latest-plex.json| grep "version" | cut -d '"' -f 4)
19-
echo "Using version: $VERSION from latest"
25+
26+
if [ "$VERSION" = latest || "$VERSION" = plexpass ]; then
27+
VERSION=$PLEX_LATEST
28+
echo "Target version: $VERSION set by: latest\plexpass"
2029
else
21-
echo "Using version: $VERSION from Manual"
30+
echo "Target version: $VERSION set by: manually"
2231
fi
2332

33+
34+
35+
2436
last=130
2537
if [[ "$VERSION" == "" ]]; then
2638
echo "ERROR: No version found, running installed version $INSTALLED"

0 commit comments

Comments
 (0)