Initial work on alter the update rutine

Removes lots of old code, replaceing with new token based
authentication.
pull/32/head
Stian Buch Larsen 9 years ago
parent ae5da8f325
commit 4e5532d782

@ -10,17 +10,29 @@ while ! ping -c1 tools.linuxserver.io &>/dev/null; do :; done
#The following error is not an error. #The following error is not an error.
INSTALLED=$(dpkg-query -W -f='${Version}' plexmediaserver) INSTALLED=$(dpkg-query -W -f='${Version}' plexmediaserver)
#Get stuff from things.
PLEX_TOKEN=$()
[ -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" [ "$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
#Start update rutine
if [[ -z $VERSION && "$PLEXPASS" == "1" || $VERSION = "plexpass" ]]; then
echo "Usage of VERSION=PLEXPASS is depricated. latest\plexpass is automatic based upon your plex account." if [ "$VERSION" = latest || "$VERSION" = plexpass ]; then
elif [[ $VERSION = "latest" || -z $VERSION ]]; then VERSION=$PLEX_LATEST
VERSION=$(curl -s https://tools.linuxserver.io/latest-plex.json| grep "version" | cut -d '"' -f 4) echo "Target version: $VERSION set by: latest\plexpass"
echo "Using version: $VERSION from latest"
else else
echo "Using version: $VERSION from Manual" echo "Target version: $VERSION set by: manually"
fi fi
last=130 last=130
if [[ "$VERSION" == "" ]]; then if [[ "$VERSION" == "" ]]; then
echo "ERROR: No version found, running installed version $INSTALLED" echo "ERROR: No version found, running installed version $INSTALLED"

Loading…
Cancel
Save