Initial work on alter the update rutine
Removes lots of old code, replaceing with new token based authentication.
This commit is contained in:
parent
ae5da8f325
commit
4e5532d782
1 changed files with 19 additions and 7 deletions
|
|
@ -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)
|
||||||
|
|
||||||
[ "$PLEXPASS" ] && echo "PLEXPASS is deprecated, please use VERSION"
|
|
||||||
|
|
||||||
if [[ -z $VERSION && "$PLEXPASS" == "1" || $VERSION = "plexpass" ]]; then
|
#Get stuff from things.
|
||||||
echo "Usage of VERSION=PLEXPASS is depricated. latest\plexpass is automatic based upon your plex account."
|
PLEX_TOKEN=$()
|
||||||
elif [[ $VERSION = "latest" || -z $VERSION ]]; then
|
[ -z PLEX_TOKEN ] && echo "Plex token not avalible, please login " && exit 0
|
||||||
VERSION=$(curl -s https://tools.linuxserver.io/latest-plex.json| grep "version" | cut -d '"' -f 4)
|
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 )
|
||||||
echo "Using version: $VERSION from latest"
|
|
||||||
|
[ "$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 [ "$VERSION" = latest || "$VERSION" = plexpass ]; then
|
||||||
|
VERSION=$PLEX_LATEST
|
||||||
|
echo "Target version: $VERSION set by: latest\plexpass"
|
||||||
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…
Add table
Add a link
Reference in a new issue