diff --git a/Dockerfile b/Dockerfile index 2b0225f..d164bbb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,9 +4,9 @@ MAINTAINER Stian Larsen # Install Plex RUN apt-get -q update && \ PLEXURL=$(curl -s https://tools.linuxserver.io/latest-plex.json| grep "ubuntu64" | cut -d '"' -f 4) && \ -apt-get install -qy dbus gdebi-core avahi-daemon wget && \ +apt-get install -qy dbus avahi-daemon wget && \ wget -P /tmp "$PLEXURL" && \ -gdebi -n /tmp/plexmediaserver_*_amd64.deb && \ +dpkg -i /tmp/plexmediaserver_*_amd64.deb && \ rm -f /tmp/plexmediaserver_*_amd64.deb && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* @@ -22,4 +22,4 @@ ADD plexmediaserver /defaults/plexmediaserver #Mappings and ports VOLUME ["/config", "/transcode"] -EXPOSE 32400 +EXPOSE 32400 32400/udp 32469 32469/udp 5353/udp 1900/udp diff --git a/README.md b/README.md index bcdba3d..0fd0aa6 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,6 @@ docker create \ --net=host \ -e VERSION=plexpass \ -e PUID= -e PGID= \ - -v :/transcode \ -v :/config \ -v :/data/tvshows \ -v :/data/movies \ @@ -30,7 +29,6 @@ docker create \ * `--net=host` - Shares host networking with container, **required**. * `-v /config` - Plex library location. *This can grow very large, 50gb+ is likely for a large collection.* -* `-v /transcode` *(optional)* - Transcode directory to offload heavy writes in a docker container. * `-v /data/xyz` - Media goes here. Add as many as needed e.g. `/data/movies`, `/data/tv`, etc. * `-e VERSION=` - *(optional)* - Permits specific version selection e.g. `0.9.12.4.1192-9a47d21`, also supports `plexpass` or `latest` * `-e PGID=` for for GroupID - see below for explanation diff --git a/init/15_fix_for_transcode.sh b/init/15_fix_for_transcode.sh deleted file mode 100644 index b13e7a2..0000000 --- a/init/15_fix_for_transcode.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -chown -c abc:abc /transcode diff --git a/init/30_update_plex.sh b/init/30_update_plex.sh index fa8594d..6239ad7 100644 --- a/init/30_update_plex.sh +++ b/init/30_update_plex.sh @@ -10,18 +10,31 @@ while ! ping -c1 tools.linuxserver.io &>/dev/null; do :; done #The following error is not an error. INSTALLED=$(dpkg-query -W -f='${Version}' plexmediaserver) -[ "$PLEXPASS" ] && echo "PLEXPASS is deprecated, please use VERSION" -if [[ -z $VERSION && "$PLEXPASS" == "1" || $VERSION = "plexpass" ]]; then - VERSION=$(curl -s https://tools.linuxserver.io/latest-plexpass.json | grep "version" | cut -d '"' -f 4) - echo "Using version: $VERSION from Plexpass latest" -elif [[ $VERSION = "latest" || -z $VERSION ]]; then - VERSION=$(curl -s https://tools.linuxserver.io/latest-plex.json| grep "version" | cut -d '"' -f 4) - echo "Using version: $VERSION from Public latest" +#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 + + +#Start update rutine + + +if [[ "$VERSION" = latest || "$VERSION" = plexpass ]]; then + VERSION=$PLEX_LATEST + echo "Target version: $VERSION set by: latest\plexpass" +elif [[ -z "$VERSION" ]]; then + echo "Target version: Version not set, Defaulting to supplied version" else - echo "Using version: $VERSION from Manual" + echo "Target version: $VERSION set by: manually" fi + + + last=130 if [[ "$VERSION" == "" ]]; then echo "ERROR: No version found, running installed version $INSTALLED" @@ -33,7 +46,7 @@ elif [[ "$VERSION" != "$INSTALLED" ]]; then last=$? done apt-get remove --purge -y plexmediaserver - gdebi -n /tmp/plexmediaserver_"${VERSION}"_amd64.deb + dpkg -i /tmp/plexmediaserver_"${VERSION}"_amd64.deb else echo "No need to update!" fi diff --git a/plexmediaserver b/plexmediaserver index 0df302f..071c896 100644 --- a/plexmediaserver +++ b/plexmediaserver @@ -6,9 +6,6 @@ PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6 # ulimit -s $PLEX_MEDIA_SERVER_MAX_STACK_SIZE PLEX_MEDIA_SERVER_MAX_STACK_SIZE=3000 -# where the mediaserver should store the transcodes -PLEX_MEDIA_SERVER_TMPDIR=/transcode - # uncomment to set it to something else PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="/config/Library/Application Support"