diff --git a/Dockerfile b/Dockerfile index 6ee20fa3..fc0caae1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,32 @@ -FROM ubuntu:20.04 - -ARG S6_OVERLAY_VERSION=v2.2.0.3 -ARG S6_OVERLAY_ARCH=amd64 +FROM ubuntu:22.04 as base-amd64 +ARG S6_OVERLAY_VERSION=v3.1.5.0 +ARG S6_OVERLAY_ARCH=x86_64 ARG PLEX_BUILD=linux-x86_64 -ARG PLEX_DISTRO=debian -ARG DEBIAN_FRONTEND="noninteractive" ARG INTEL_NEO_VERSION=20.48.18558 ARG INTEL_IGC_VERSION=1.0.5699 ARG INTEL_GMMLIB_VERSION=20.3.2 -ENV TERM="xterm" LANG="C.UTF-8" LC_ALL="C.UTF-8" -ENTRYPOINT ["/init"] +FROM arm64v8/ubuntu:22.04 as base-arm64 +ARG S6_OVERLAY_VERSION=v3.1.5.0 +ARG S6_OVERLAY_ARCH=aarch64 +ARG PLEX_BUILD=linux-aarch64 + +FROM arm32v7/ubuntu:22.04 as base-arm +ARG S6_OVERLAY_VERSION=v3.1.5.0 +ARG S6_OVERLAY_ARCH=arm +ARG PLEX_BUILD=linux-armv7hf_neon + +FROM i386/ubuntu:18.04 as base-386 +ARG S6_OVERLAY_VERSION=v3.1.5.0 +ARG S6_OVERLAY_ARCH=i686 +ARG PLEX_BUILD=linux-x86 + +FROM base-${TARGETARCH} AS plex +ARG TARGETARCH +RUN echo Building pms-docker for ${TARGETARCH} + +ARG DEBIAN_FRONTEND="noninteractive" +ARG PLEX_DISTRO=debian RUN \ # Update and get dependencies @@ -18,15 +34,21 @@ RUN \ apt-get install -y \ tzdata \ curl \ + xz-utils \ xmlstarlet \ uuid-runtime \ unrar \ + cron \ + multitail \ && \ \ # Fetch and extract S6 overlay - curl -J -L -o /tmp/s6-overlay-${S6_OVERLAY_ARCH}.tar.gz https://github.com/just-containers/s6-overlay/releases/download/${S6_OVERLAY_VERSION}/s6-overlay-${S6_OVERLAY_ARCH}.tar.gz && \ - tar xzf /tmp/s6-overlay-${S6_OVERLAY_ARCH}.tar.gz -C / --exclude='./bin' && \ - tar xzf /tmp/s6-overlay-${S6_OVERLAY_ARCH}.tar.gz -C /usr ./bin && \ + curl -L -s \ + "https://github.com/just-containers/s6-overlay/releases/download/${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz" | tar Jxpf - -C / \ + && \ + curl -L -s \ + "https://github.com/just-containers/s6-overlay/releases/download/${S6_OVERLAY_VERSION}/s6-overlay-${S6_OVERLAY_ARCH}.tar.xz" | tar Jxpf - -C / \ + && \ \ # Add user useradd -U -d /config -s /bin/false plex && \ @@ -49,16 +71,35 @@ RUN \ EXPOSE 32400/tcp 8324/tcp 32469/tcp 1900/udp 32410/udp 32412/udp 32413/udp 32414/udp VOLUME /config /transcode -ENV CHANGE_CONFIG_DIR_OWNERSHIP="true" \ - HOME="/config" - -ARG TAG=beta +# TAG can be "autoupdate" or an explicit version, like 1.32.4.7195-7c8f9d3b6 +ARG TAG="autoupdate" ARG URL= +ARG DEBUG= + +ENV CHANGE_CONFIG_DIR_OWNERSHIP="true" \ + HOME="/config" \ +# Note, only used for images built with TAG=autoupdate + AUTO_UPDATE_CHANNEL="beta" \ + \ + TERM="xterm" \ + LANG="C.UTF-8" \ + LC_ALL="C.UTF-8" \ + \ + S6_KEEP_ENV=1 \ + S6_SERVICES_GRACETIME=10000 \ + S6_KILL_GRACETIME=5000 \ + S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0 \ + S6_BEHAVIOUR_IF_STAGE2_FAILS=2 COPY root/ / RUN \ # Save version and install - /installBinary.sh + /installBinary.sh \ + && \ +# Clean up installer + rm /installBinary.sh HEALTHCHECK --interval=5s --timeout=2s --retries=20 CMD /healthcheck.sh || exit 1 + +ENTRYPOINT ["/init"] diff --git a/Dockerfile.arm64 b/Dockerfile.arm64 deleted file mode 100644 index 5450840c..00000000 --- a/Dockerfile.arm64 +++ /dev/null @@ -1,61 +0,0 @@ -FROM ubuntu:20.04 - -ARG S6_OVERLAY_VERSION=v2.2.0.3 -ARG S6_OVERLAY_ARCH=aarch64 -ARG PLEX_BUILD=linux-aarch64 -ARG PLEX_DISTRO=debian -ARG DEBIAN_FRONTEND="noninteractive" -ENV TERM="xterm" LANG="C.UTF-8" LC_ALL="C.UTF-8" - -ENTRYPOINT ["/init"] - -RUN \ -# Update and get dependencies - apt-get update && \ - apt-get install -y \ - tzdata \ - curl \ - xmlstarlet \ - uuid-runtime \ - unrar \ - && \ - \ -# Fetch and extract S6 overlay - curl -J -L -o /tmp/s6-overlay-${S6_OVERLAY_ARCH}.tar.gz https://github.com/just-containers/s6-overlay/releases/download/${S6_OVERLAY_VERSION}/s6-overlay-${S6_OVERLAY_ARCH}.tar.gz && \ - tar xzf /tmp/s6-overlay-${S6_OVERLAY_ARCH}.tar.gz -C / --exclude='./bin' && \ - tar xzf /tmp/s6-overlay-${S6_OVERLAY_ARCH}.tar.gz -C /usr ./bin && \ - \ -# Add user - useradd -U -d /config -s /bin/false plex && \ - usermod -G users plex && \ - \ -# Setup directories - mkdir -p \ - /config \ - /transcode \ - /data \ - && \ - \ -# Cleanup - apt-get -y autoremove && \ - apt-get -y clean && \ - rm -rf /var/lib/apt/lists/* && \ - rm -rf /tmp/* && \ - rm -rf /var/tmp/* - -EXPOSE 32400/tcp 8324/tcp 32469/tcp 1900/udp 32410/udp 32412/udp 32413/udp 32414/udp -VOLUME /config /transcode - -ENV CHANGE_CONFIG_DIR_OWNERSHIP="true" \ - HOME="/config" - -ARG TAG=beta -ARG URL= - -COPY root/ / - -RUN \ -# Save version and install - /installBinary.sh - -HEALTHCHECK --interval=5s --timeout=2s --retries=20 CMD /healthcheck.sh || exit 1 diff --git a/Dockerfile.armv7 b/Dockerfile.armv7 deleted file mode 100644 index 043a4aa2..00000000 --- a/Dockerfile.armv7 +++ /dev/null @@ -1,61 +0,0 @@ -FROM ubuntu:20.04 - -ARG S6_OVERLAY_VERSION=v2.2.0.3 -ARG S6_OVERLAY_ARCH=armhf -ARG PLEX_BUILD=linux-armv7hf_neon -ARG PLEX_DISTRO=debian -ARG DEBIAN_FRONTEND="noninteractive" -ENV TERM="xterm" LANG="C.UTF-8" LC_ALL="C.UTF-8" - -ENTRYPOINT ["/init"] - -RUN \ -# Update and get dependencies - apt-get update && \ - apt-get install -y \ - tzdata \ - curl \ - xmlstarlet \ - uuid-runtime \ - unrar \ - && \ - \ -# Fetch and extract S6 overlay - curl -J -L -o /tmp/s6-overlay-${S6_OVERLAY_ARCH}.tar.gz https://github.com/just-containers/s6-overlay/releases/download/${S6_OVERLAY_VERSION}/s6-overlay-${S6_OVERLAY_ARCH}.tar.gz && \ - tar xzf /tmp/s6-overlay-${S6_OVERLAY_ARCH}.tar.gz -C / --exclude='./bin' && \ - tar xzf /tmp/s6-overlay-${S6_OVERLAY_ARCH}.tar.gz -C /usr ./bin && \ - \ -# Add user - useradd -U -d /config -s /bin/false plex && \ - usermod -G users plex && \ - \ -# Setup directories - mkdir -p \ - /config \ - /transcode \ - /data \ - && \ - \ -# Cleanup - apt-get -y autoremove && \ - apt-get -y clean && \ - rm -rf /var/lib/apt/lists/* && \ - rm -rf /tmp/* && \ - rm -rf /var/tmp/* - -EXPOSE 32400/tcp 8324/tcp 32469/tcp 1900/udp 32410/udp 32412/udp 32413/udp 32414/udp -VOLUME /config /transcode - -ENV CHANGE_CONFIG_DIR_OWNERSHIP="true" \ - HOME="/config" - -ARG TAG=beta -ARG URL= - -COPY root/ / - -RUN \ -# Save version and install - /installBinary.sh - -HEALTHCHECK --interval=5s --timeout=2s --retries=20 CMD /healthcheck.sh || exit 1 diff --git a/Dockerfile.i386 b/Dockerfile.i386 deleted file mode 100644 index 3ed88af8..00000000 --- a/Dockerfile.i386 +++ /dev/null @@ -1,60 +0,0 @@ -FROM i386/ubuntu:18.04 - -ARG S6_OVERLAY_VERSION=v2.2.0.3 -ARG S6_OVERLAY_ARCH=x86 -ARG PLEX_BUILD=linux-x86 -ARG PLEX_DISTRO=debian -ARG DEBIAN_FRONTEND="noninteractive" -ENV TERM="xterm" LANG="C.UTF-8" LC_ALL="C.UTF-8" - -ENTRYPOINT ["/init"] - -RUN \ -# Update and get dependencies - apt-get update && \ - apt-get install -y \ - tzdata \ - curl \ - xmlstarlet \ - uuid-runtime \ - unrar \ - && \ - \ -# Fetch and extract S6 overlay - curl -J -L -o /tmp/s6-overlay-${S6_OVERLAY_ARCH}.tar.gz https://github.com/just-containers/s6-overlay/releases/download/${S6_OVERLAY_VERSION}/s6-overlay-${S6_OVERLAY_ARCH}.tar.gz && \ - tar xzf /tmp/s6-overlay-${S6_OVERLAY_ARCH}.tar.gz -C / && \ - \ -# Add user - useradd -U -d /config -s /bin/false plex && \ - usermod -G users plex && \ - \ -# Setup directories - mkdir -p \ - /config \ - /transcode \ - /data \ - && \ - \ -# Cleanup - apt-get -y autoremove && \ - apt-get -y clean && \ - rm -rf /var/lib/apt/lists/* && \ - rm -rf /tmp/* && \ - rm -rf /var/tmp/* - -EXPOSE 32400/tcp 8324/tcp 32469/tcp 1900/udp 32410/udp 32412/udp 32413/udp 32414/udp -VOLUME /config /transcode - -ENV CHANGE_CONFIG_DIR_OWNERSHIP="true" \ - HOME="/config" - -ARG TAG=beta -ARG URL= - -COPY root/ / - -RUN \ -# Save version and install - /installBinary.sh - -HEALTHCHECK --interval=5s --timeout=2s --retries=20 CMD /healthcheck.sh || exit 1 diff --git a/README.md b/README.md index c89ba230..b4ec0559 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,10 @@ The provided `docker-compose` templates use the `plexinc/pms-docker` image which To use `docker-compose` with ARM devices, you must first build one of the ARM images locally. ```sh -docker build -t plexinc/pms-docker:latest -f Dockerfile.armv7 . # or arm64 +# arm 32 bit +docker build --platform linux/arm/v7 -t plexinc/pms-docker:latest . +# arm 64 bit +docker build --platform linux/arm64 -t plexinc/pms-docker:latest . ``` Then you can `docker-compose up`. @@ -138,9 +141,14 @@ uid=1001(myuser) gid=1001(myuser) groups=1001(myuser) In the above case, if you set the `PLEX_UID` and `PLEX_GID` to `1001`, then the permissions will match that of your own user. ## Tags -In addition to the standard version and `latest` tags, two other tags exist: `beta` and `public`. These two images behave differently than your typical containers. These two images do **not** have any Plex Media Server binary installed. Instead, when these containers are run, they will perform an update check and fetch the latest version, install it, and then continue execution. They also run the update check whenever the container is restarted. To update the version in the container, simply stop the container and start container again when you have a network connection. The startup script will automatically fetch the appropriate version and install it before starting the Plex Media Server. +In addition to the standard version and `latest` tags, there is a special `autoupdate` tag. This container behaves differently than typical containers. The `autoupdate` container does **not** have any Plex Media Server binary installed. Instead, every time this container is run, it checks to see if the server is installed. If it is (because you've already started this container before) it starts the server. If it wasn't installed (because this is the first time the server is starting) it will install it, then start the server. -The `public` restricts this check to public versions only where as `beta` will fetch beta versions. If the server is not logged in or you do not have Plex Pass on your account, the `beta` tagged images will be restricted to publicly available versions only. +The `autoupdate` container will automatically check for new updates every day between 4:00am - 4:30am (according to timezone set in `TZ`). + +- **AUTO_UPDATE_CHANNEL** This variable can only be `public` or `beta` (default). The `public` value restricts this check to public versions only whereas `beta` value will fetch beta versions. If the server is not logged in or you do not have Plex Pass on your account, the `beta` tagged images will be restricted to publicly available versions only. + +### Forcing an update/install on startup +- Create an empty file called `_force_` in the `/config` directory. (i.e. `touch /config/_force_`) You can also manually force an update by simply recreating the image. Just restarting the container (or stopping and starting) will not normally update the existing installation within the container. To view the Docker images head over to [https://hub.docker.com/r/plexinc/pms-docker/tags/](https://hub.docker.com/r/plexinc/pms-docker/tags/) @@ -158,11 +166,18 @@ If you wish to migrate an existing directory to the docker config directory: - Note: by default Plex will claim ownership of the entire contents of the `config` dir (see CHANGE_CONFIG_DIR_OWNERSHIP for more information). As such, there should be nothing in that dir that you do not wish for Plex to own. ## Useful information -- Start the container: `docker start plex` -- Stop the container: `docker stop plex` -- Shell access to the container while it is running: `docker exec -it plex /bin/bash` -- See the logs given by the startup script in real time: `docker logs -f plex` -- Restart the application and upgrade to the latest version: `docker restart plex` +- Start the container: + - `docker start plex` +- Stop the container: + - `docker stop plex` +- Shell access to the container while it is running: + - `docker exec -it plex /bin/bash` +- See the logs given by the startup script in real time: + - `docker logs -f plex` +- Monitor all Plex Media Server logs: + - `docker exec -it plex /plex-logs.sh` +- Restart the application: + - `docker restart plex` ## Fedora, CentOS, Red Hat diff --git a/dev/README.md b/dev/README.md new file mode 100644 index 00000000..10273217 --- /dev/null +++ b/dev/README.md @@ -0,0 +1,45 @@ +# Dev Helper Scripts + +Hey homelab enthusiast! + +Unless you are enhancing these Dockerfile themselves, please ignore all the files here. In fact, your environment may be very different and these scripts may not work at all. These are just provided only as a reference/starting point so you don't have to start from scratch. + +You might just consider extending the images here. i.e. + +``` +FROM plexinc/pms-docker:latest + +RUN echo "Add your modifications here" +``` + +Otherwise, `dev.sh` will build all of the multi-platform docker images, for each platform it will build one that uses a specific version, and `autoupdate` version that doesn't bake the binary into the image, but rather downloads when container boots. Look inside the script for more info. + +`docker-bake.hcl` is a buildx bake file that will build all platforms, using pre-installed binaries and `update` versions. This bake file will push to dockerhub. You can override the destination using the `dockerhub_image` variable in `dev.sh`. + + +### Examples + +#### Prereqs: +- [docker](https://docs.docker.com/engine/install/) +- [buildx](https://github.com/docker/buildx) +- x86 based linux host + +```sh +# sets up buildx for multi-arch builds +./dev.sh setup + +# bake - build all and push to dockerhub +./dev.sh bake + +# build version-specific and autoupdate image for amd64 +./dev.sh build amd64 + +# build everything +./dev.sh buildall + +# launches version-specific container +./dev.sh debug amd64 + +# launches auto-update container +./dev.sh debug amd64 autoupdate +``` diff --git a/dev/dev.sh b/dev/dev.sh new file mode 100755 index 00000000..1ec1d54e --- /dev/null +++ b/dev/dev.sh @@ -0,0 +1,104 @@ +#!/bin/bash +set -euo pipefail +IFS=$'\n\t' + +# This is just a helper script to quickly test local Dockerfile builds, please run setup() once +# Assumes this is running on Linux (any distro) using (intel/amd). + +# This bakes the specific binary into the image, you can override these vars on command line +# prompt> DOCKERHUB_IMAGE=myorg/mycontainer ./dev/sh bake +VERSION_TO_BUILD=${VERSION_TO_BUILD:-"1.32.4.7195-7c8f9d3b6"} +DOCKERHUB_IMAGE=${DOCKERHUB_IMAGE:-"plexinc/pms-docker"} +# launch with KEEP=true to keep the container after starting/running it - manual cleanup required when done +# prompt> KEEP=true ./dev.sh debug arm64v8 autoupdate +KEEP=${KEEP:-} + +setup() { + # Create a multi-arch buildx builder named PlexBuilder (if it doesn't exist) + if ! docker buildx inspect PlexBuilder 1> /dev/null 2>& 1; then + echo Creating PlexBuilder + # --use will make it automatically use this builder + docker buildx create --name PlexBuilder --platform linux/arm64,linux/arm/v7,linux/386 --use + # this is needed to register the arch-specific images with QEMU to be able to test + # these without native hardware + docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + fi +} +build() { + platform=$1 + name=$2 + docker buildx build \ + --progress=plain \ + -o type=docker \ + --load \ + --platform "$platform" \ + --build-arg \ + "TAG=$VERSION_TO_BUILD" \ + -t "$name:$VERSION_TO_BUILD" \ + -t "$name:latest" \ + -f ../Dockerfile .. + docker buildx build \ + --progress=plain \ + -o type=docker \ + --load \ + --platform "$platform" \ + --build-arg \ + "TAG=autoupdate" \ + -t "$name:autoupdate" \ + -f ../Dockerfile .. +} + +debug() { + platform=$1 + name=$2 + autoupdate=$3 + [ "$autoupdate" = "autoupdate" ] && name=$name:autoupdate || name=$name:latest + if [[ $platform == linux/arm* ]]; then + # shellcheck disable=SC2064 + trap "trap - SIGTERM && docker stop debug-${name/:/_}" SIGINT SIGTERM EXIT + if [ "${KEEP,,}" = "true" ]; then + if docker start "debug-${name/:/_}"; then + docker attach "debug-${name/:/_}" & + else + docker run --name "debug-${name/:/_}" --platform "$platform" -e DEBUG=true "$name" & + fi + else + docker run -rm --name "debug-${name/:/_}" --platform "$platform" -e DEBUG=true "$name" & + fi + sleep 5 + docker exec -it "debug-${name/:/_}" bash + else + if [ "${KEEP,,}" = "true" ]; then + if docker start "debug-${name/:/_}"; then + # shellcheck disable=SC2064 + trap "trap - SIGTERM && docker stop debug-${name/:/_}" SIGINT SIGTERM EXIT + docker attach "debug-${name/:/_}" + else + docker run --name "debug-${name/:/_}" --platform "$platform" -e DEBUG=true -it "$name" bash + fi + else + docker run -rm --name "debug-${name/:/_}" --platform "$platform" -e DEBUG=true -it "$name" bash + fi + fi +} + +cmd=${1:-} +kind=${2:-} +[ "$cmd" = 'setup' ] && setup +[ "$cmd" = 'build' ] && [ "$kind" = '386' ] && build linux/386 pms-386 +[ "$cmd" = 'build' ] && [ "$kind" = 'amd64' ] && build linux/amd64 pms-amd64 +[ "$cmd" = 'build' ] && [ "$kind" = 'arm32v7' ] && build linux/arm/v7 pms-arm32v7 +[ "$cmd" = 'build' ] && [ "$kind" = 'arm64v8' ] && build linux/arm64 pms-arm64v8 +[ "$cmd" = 'buildall' ] && \ + build linux/386 pms-386 && \ + build linux/amd64 pms-amd64 && \ + build linux/arm/v7 pms-arm32v7 && \ + build linux/arm64 pms-arm64v8 + +[ "$cmd" = 'bake' ] && TAG=$VERSION_TO_BUILD IMAGE=$DOCKERHUB_IMAGE docker buildx bake + +autoupdate=${3:-} +[ "$cmd" = 'debug' ] && [ "$kind" = '386' ] && debug linux/386 pms-386 "$autoupdate" +[ "$cmd" = 'debug' ] && [ "$kind" = 'amd64' ] && debug linux/amd64 pms-amd64 "$autoupdate" +[ "$cmd" = 'debug' ] && [ "$kind" = 'arm32v7' ] && debug linux/arm/v7 pms-arm32v7 "$autoupdate" +[ "$cmd" = 'debug' ] && [ "$kind" = 'arm64v8' ] && debug linux/arm64 pms-arm64v8 "$autoupdate" diff --git a/dev/docker-bake.hcl b/dev/docker-bake.hcl new file mode 100644 index 00000000..35e5df1e --- /dev/null +++ b/dev/docker-bake.hcl @@ -0,0 +1,40 @@ +# run this file using "docker buildx bake" + +variable "TAG" { + # This should be overridden on command line to be the + # specific plex media server binary to download into the image + default = "1.32.4.7195-7c8f9d3b6" +} +variable "IMAGE" { + default = "plexinc/pms-docker" +} + +group "default" { + targets = ["plexmediaserver-versioned", "plexmediaserver-autoupdate"] +} + +target "plexmediaserver-versioned" { + # This target builds targets that downloald and pre-install the + # the plex media server binary in the container. This image + # has two tags, the version itself, and assuming this is that latest + # also tags it with :latest. + output = ["type=registry"] + context = ".." + platforms = ["linux/386", "linux/amd64", "linux/arm64", "linux/arm/v7"] + tags = ["${IMAGE}:${TAG}", "${IMAGE}:latest"] + args = { + TAG = "${TAG}" + } +} +target "plexmediaserver-autoupdate" { + # This target build a download and pre-install a configuration of the + # container automatically downloads and installs the server at runtime + # and automatically checks for updates once a day. + output = ["type=registry"] + context = ".." + platforms = ["linux/386", "linux/amd64", "linux/arm64", "linux/arm/v7"] + tags = ["${IMAGE}:autoupdate"] + args = { + TAG = "autoupdate" + } +} diff --git a/root/etc/cont-init.d/50-plex-update b/root/etc/cont-init.d/50-plex-update deleted file mode 100755 index dbaec382..00000000 --- a/root/etc/cont-init.d/50-plex-update +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/with-contenv bash - -# If we are debugging, enable trace -if [ "${DEBUG,,}" = "true" ]; then - set -x -fi - -. /plex-common.sh - -function getPref { - local key="$1" - - xmlstarlet sel -T -t -m "/Preferences" -v "@${key}" -n "${prefFile}" -} - -# Get token -[ -f /etc/default/plexmediaserver ] && . /etc/default/plexmediaserver -pmsApplicationSupportDir="${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR:-${HOME}/Library/Application Support}" -prefFile="${pmsApplicationSupportDir}/Plex Media Server/Preferences.xml" -token="$(getPref "PlexOnlineToken")" - -# Determine current version -if (dpkg --get-selections plexmediaserver 2> /dev/null | grep -wq "install"); then - installedVersion=$(dpkg-query -W -f='${Version}' plexmediaserver 2> /dev/null) -else - installedVersion="none" -fi - -# Read set version -readVarFromConf "version" versionToInstall -if [ -z "${versionToInstall}" ]; then - echo "No version specified in install. Broken image" - exit 1 -fi - -# Short-circuit test of version before remote check to see if it's already installed. -if [ "${versionToInstall}" = "${installedVersion}" ]; then - exit 0 -fi - -# Get updated version number -getVersionInfo "${versionToInstall}" "${token}" remoteVersion remoteFile - -if [ -z "${remoteVersion}" ] || [ -z "${remoteFile}" ]; then - echo "Could not get update version" - exit 0 -fi - -# Check if there's no update required -if [ "${remoteVersion}" = "${installedVersion}" ]; then - exit 0 -fi - -# Do update process -echo "Attempting to upgrade to: ${remoteVersion}" -installFromUrl "${remoteFile}" diff --git a/root/etc/cont-init.d/40-plex-first-run b/root/etc/plex/plex-first-run similarity index 80% rename from root/etc/cont-init.d/40-plex-first-run rename to root/etc/plex/plex-first-run index 4275929c..7741a0a9 100755 --- a/root/etc/cont-init.d/40-plex-first-run +++ b/root/etc/plex/plex-first-run @@ -1,4 +1,16 @@ -#!/usr/bin/with-contenv bash +#!/bin/bash +set -euo pipefail +IFS=$'\n\t' + +# set defaults +DEBUG=${DEBUG:-} +PLEX_UID=${PLEX_UID:-} +PLEX_GID=${PLEX_GID:-} +CHANGE_CONFIG_DIR_OWNERSHIP=${CHANGE_CONFIG_DIR_OWNERSHIP:-} +PLEX_CLAIM=${PLEX_CLAIM:-} +PLEX_CLAIM_FILE=${PLEX_CLAIM_FILE:-} +ADVERTISE_IP=${ADVERTISE_IP:-} +ALLOWED_NETWORKS=${ALLOWED_NETWORKS:-} # If we are debugging, enable trace if [ "${DEBUG,,}" = "true" ]; then @@ -21,21 +33,21 @@ function setPref { local value="$2" count="$(xmlstarlet sel -t -v "count(/Preferences/@${key})" "${prefFile}")" - count=$(($count + 0)) - if [[ $count > 0 ]]; then + if [[ $count -gt 0 ]]; then xmlstarlet ed --inplace --update "/Preferences/@${key}" -v "${value}" "${prefFile}" else xmlstarlet ed --inplace --insert "/Preferences" --type attr -n "${key}" -v "${value}" "${prefFile}" fi } -home="$(echo ~plex)" +home=~plex +# shellcheck source=/dev/null [ -f /etc/default/plexmediaserver ] && . /etc/default/plexmediaserver pmsApplicationSupportDir="${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR:-${home}/Library/Application Support}" prefFile="${pmsApplicationSupportDir}/Plex Media Server/Preferences.xml" # Setup user/group ids -if [ ! -z "${PLEX_UID}" ]; then +if [ -n "${PLEX_UID}" ]; then if [ ! "$(id -u plex)" -eq "${PLEX_UID}" ]; then # usermod likes to chown the home directory, so create a new one and use that @@ -57,7 +69,7 @@ if [ ! -z "${PLEX_UID}" ]; then fi fi -if [ ! -z "${PLEX_GID}" ]; then +if [ -n "${PLEX_GID}" ]; then if [ ! "$(id -g plex)" -eq "${PLEX_GID}" ]; then groupmod -o -g "${PLEX_GID}" plex fi @@ -67,10 +79,10 @@ fi if [ "${CHANGE_CONFIG_DIR_OWNERSHIP,,}" = "true" ]; then if [ -f "${prefFile}" ]; then if [ ! "$(stat -c %u "${prefFile}")" = "$(id -u plex)" ]; then - find /config \! \( -uid $(id -u plex) -gid $(id -g plex) \) -print0 | xargs -0 chown -h plex:plex + find /config \! \( -uid "$(id -u plex)" -gid "$(id -g plex)" \) -print0 | xargs -0 chown -h plex:plex fi else - find /config \! \( -uid $(id -u plex) -gid $(id -g plex) \) -print0 | xargs -0 chown -h plex:plex + find /config \! \( -uid "$(id -u plex)" -gid "$(id -g plex)" \) -print0 | xargs -0 chown -h plex:plex fi chown -R plex:plex /transcode fi @@ -101,12 +113,12 @@ fi # Get server token and only turn claim token into server token if we have former but not latter. token="$(getPref "PlexOnlineToken")" if [ -z "${PLEX_CLAIM}" ] && [ -f "${PLEX_CLAIM_FILE}" ]; then - PLEX_CLAIM=$(cat ${PLEX_CLAIM_FILE}) + PLEX_CLAIM=$(cat "${PLEX_CLAIM_FILE}") fi -if [ ! -z "${PLEX_CLAIM}" ] && [ -z "${token}" ]; then +if [ -n "${PLEX_CLAIM}" ] && [ -z "${token}" ]; then echo "Attempting to obtain server token from claim token" loginInfo="$(curl -X POST \ - -H 'X-Plex-Client-Identifier: '${clientId} \ + -H 'X-Plex-Client-Identifier: '"${clientId}" \ -H 'X-Plex-Product: Plex Media Server'\ -H 'X-Plex-Version: 1.1' \ -H 'X-Plex-Provides: server' \ @@ -123,11 +135,11 @@ if [ ! -z "${PLEX_CLAIM}" ] && [ -z "${token}" ]; then fi fi -if [ ! -z "${ADVERTISE_IP}" ]; then +if [ -n "${ADVERTISE_IP}" ]; then setPref "customConnections" "${ADVERTISE_IP}" fi -if [ ! -z "${ALLOWED_NETWORKS}" ]; then +if [ -n "${ALLOWED_NETWORKS}" ]; then setPref "allowedNetworks" "${ALLOWED_NETWORKS}" fi diff --git a/root/etc/cont-init.d/45-plex-hw-transcode-and-connected-tuner b/root/etc/plex/plex-hw-transcode-and-connected-tuner similarity index 84% rename from root/etc/cont-init.d/45-plex-hw-transcode-and-connected-tuner rename to root/etc/plex/plex-hw-transcode-and-connected-tuner index d09a129e..edf5ab17 100755 --- a/root/etc/cont-init.d/45-plex-hw-transcode-and-connected-tuner +++ b/root/etc/plex/plex-hw-transcode-and-connected-tuner @@ -1,4 +1,4 @@ -#!/usr/bin/with-contenv bash +#!/bin/bash # Check to make sure the devices exists. If not, exit as there is nothing for us to do if [ ! -e /dev/dri ] && [ ! -e /dev/dvb ]; then @@ -22,10 +22,10 @@ do fi # If plex user isn't part of this group, add them - if [ ! $(getent group "${CURRENT_GROUP}" | grep &>/dev/null plex) ]; then + if ! getent group "${CURRENT_GROUP}" | grep -q plex; then usermod -a -G "${CURRENT_GROUP}" plex fi - GROUP_COUNT=$(($GROUP_COUNT + 1)) + GROUP_COUNT=$((GROUP_COUNT + 1)) done diff --git a/root/etc/plex/plex-startup b/root/etc/plex/plex-startup new file mode 100755 index 00000000..122caa5f --- /dev/null +++ b/root/etc/plex/plex-startup @@ -0,0 +1,18 @@ +#!/bin/bash +set -euo pipefail +IFS=$'\n\t' + +# This script is called by the autoupdate, beta, and public tags only + +DEBUG=${DEBUG:-} + +# If we are debugging, enable trace +if [ "${DEBUG,,}" = "true" ]; then + set -x +fi + + +if [ -f /config/_force_ ] || ! dpkg --get-selections plexmediaserver 2> /dev/null | grep -wq "install"; then + echo "Downloading latest plex version..." + exec /etc/plex/plex-update +fi diff --git a/root/etc/plex/plex-update b/root/etc/plex/plex-update new file mode 100755 index 00000000..5def972b --- /dev/null +++ b/root/etc/plex/plex-update @@ -0,0 +1,74 @@ +#!/bin/bash +set -euo pipefail +IFS=$'\n\t' + +# This script is called by cron, or by plex-startup + +DEBUG=${DEBUG:-} +AUTO_UPDATE_CHANNEL=${AUTO_UPDATE_CHANNEL:-} + +# If we are debugging, enable trace +if [ "${DEBUG,,}" = "true" ]; then + set -x +fi +# shellcheck source=../../plex-common.sh +. /plex-common.sh + +function getPref { + local key="$1" + + xmlstarlet sel -T -t -m "/Preferences" -v "@${key}" -n "${prefFile}" +} + +# Get token +# shellcheck source=/dev/null +[ -f /etc/default/plexmediaserver ] && . /etc/default/plexmediaserver +pmsApplicationSupportDir="${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR:-${HOME}/Library/Application Support}" +prefFile="${pmsApplicationSupportDir}/Plex Media Server/Preferences.xml" +token="$(getPref "PlexOnlineToken")" + +# Determine current version +if (dpkg --get-selections plexmediaserver 2> /dev/null | grep -wq "install"); then + installedVersion=$(dpkg-query -W -f='${Version}' plexmediaserver 2> /dev/null) +else + installedVersion="none" +fi + +# Get updated version number +tag= +readVarFromConf "tag" tag +channel=$AUTO_UPDATE_CHANNEL +if [ "${tag,,}" = 'beta' ] || [ "${tag,,}" = 'public' ]; then + channel=$tag +fi +remoteVersion= +remoteFile= +remoteFileHashSha256= +getVersionInfo "${channel}" "${token}" remoteVersion remoteFile remoteFileHashSha256 + +if [ -z "${remoteVersion}" ] || [ -z "${remoteFile}" ]; then + echo "Could not get update version" + exit 0 +fi + +# Check if there's no update required +if [ "${remoteVersion}" = "${installedVersion}" ]; then + echo "$(date) Update check: no updates found." + exit 0 +fi + +# Do update process +wasrunning=false +echo "$(date) Attempting to upgrade to: ${remoteVersion}" +if [ -d "/run/s6/legacy-services/plex" ]; then + wasrunning=true + echo "$(date) Bringing down Plex Media Server..." + s6-svc -wD -d /run/s6/legacy-services/plex +fi +echo "$(date) Downloading and installing..." +installFromUrl "${remoteFile}" "${remoteFileHashSha256}" +if [ "$wasrunning" = true ]; then + echo "$(date) Bringing up Plex Media Server..." + s6-svc -wU -u /run/s6/legacy-services/plex +fi +echo "$(date) Plex Successfully Updated!" diff --git a/root/etc/plex/service.cron.run b/root/etc/plex/service.cron.run new file mode 100755 index 00000000..cf6a80f1 --- /dev/null +++ b/root/etc/plex/service.cron.run @@ -0,0 +1,15 @@ +#!/bin/bash +set -euo pipefail +IFS=$'\n\t' + +DEBUG=${DEBUG:-} + +# If we are debugging, enable trace +if [ "${DEBUG,,}" = "true" ]; then + set -x +fi + +# shellcheck source=../../plex-envvars +. /plex-envvars +printenv > /etc/environment +exec cron -f diff --git a/root/etc/plex/service.plex.run b/root/etc/plex/service.plex.run new file mode 100755 index 00000000..a5e4d487 --- /dev/null +++ b/root/etc/plex/service.plex.run @@ -0,0 +1,23 @@ +#!/bin/bash +set -euo pipefail +IFS=$'\n\t' + +DEBUG=${DEBUG:-} + +# If we are debugging, enable trace +if [ "${DEBUG,,}" = "true" ]; then + set -x +fi + +# shellcheck source=../../plex-envvars +. /plex-envvars + +if [ ! -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" ]; then + /bin/mkdir -p "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" + chown plex:plex "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" +fi + +echo "$(date) Starting Plex Media Server $(dpkg-query -W -f='${Version}' plexmediaserver)" +echo + +exec s6-setuidgid plex /usr/lib/plexmediaserver/Plex\ Media\ Server diff --git a/root/etc/services.d/plex/finish b/root/etc/services.d/plex/finish deleted file mode 100644 index f83c58d6..00000000 --- a/root/etc/services.d/plex/finish +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/with-contenv bash -# Copied from the init.d stop method from non-Dockerized Plex. - -echo "Stopping Plex Media Server." - -# Ask nicely -pids="$(ps -ef | grep 'Plex Media Server' | grep -v grep | awk '{print $2}')" -kill -15 $pids - -sleep 5 - -# Stuck -pids="$(ps -ef | grep /usr/lib/plexmediaserver | grep -v grep | awk '{print $2}')" - -if [ "$pids" != "" ]; then - kill -9 $pids - sleep 2 -fi diff --git a/root/etc/services.d/plex/run b/root/etc/services.d/plex/run deleted file mode 100755 index 5dfa8853..00000000 --- a/root/etc/services.d/plex/run +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/with-contenv bash - -echo "Starting Plex Media Server." -home="$(echo ~plex)" -export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR:-${home}/Library/Application Support}" -export PLEX_MEDIA_SERVER_HOME=/usr/lib/plexmediaserver -export PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6 -export PLEX_MEDIA_SERVER_INFO_VENDOR=Docker -export PLEX_MEDIA_SERVER_INFO_DEVICE="Docker Container" -export PLEX_MEDIA_SERVER_INFO_MODEL=$(uname -m) -export PLEX_MEDIA_SERVER_INFO_PLATFORM_VERSION=$(uname -r) - -if [ ! -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" ]; then - /bin/mkdir -p "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" - chown plex:plex "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" -fi - -exec s6-setuidgid plex /usr/lib/plexmediaserver/Plex\ Media\ Server diff --git a/root/etc/services.d/plex/timeout-finish b/root/etc/services.d/plex/timeout-finish deleted file mode 100644 index e002b362..00000000 --- a/root/etc/services.d/plex/timeout-finish +++ /dev/null @@ -1 +0,0 @@ -8000 diff --git a/root/healthcheck.sh b/root/healthcheck.sh index 038e8c78..c48a0891 100755 --- a/root/healthcheck.sh +++ b/root/healthcheck.sh @@ -1,7 +1,9 @@ -#!/bin/sh -e +#!/bin/bash +set -euo pipefail +IFS=$'\n\t' TARGET=localhost -CURL_OPTS="--connect-timeout 15 --max-time 100 --silent --show-error --fail" +CURL_OPTS=(--connect-timeout 15 --max-time 100 --silent --show-error --fail) -curl ${CURL_OPTS} "http://${TARGET}:32400/identity" >/dev/null +curl "${CURL_OPTS[@]}" "http://${TARGET}:32400/identity" >/dev/null diff --git a/root/installBinary.sh b/root/installBinary.sh index a3a62a49..6c986f39 100755 --- a/root/installBinary.sh +++ b/root/installBinary.sh @@ -1,16 +1,45 @@ #!/bin/bash +set -euo pipefail +IFS=$'\n\t' + +DEBUG=${DEBUG:-} + +# If we are debugging, enable trace +if [ "${DEBUG,,}" = "true" ]; then + set -x +fi . /plex-common.sh -addVarToConf "version" "${TAG}" +addVarToConf "tag" "${TAG}" addVarToConf "plex_build" "${PLEX_BUILD}" addVarToConf "plex_distro" "${PLEX_DISTRO}" -if [ ! -z "${URL}" ]; then +# Setup common services +echo "Creating services" +mkdir -p /etc/services.d/plex ; ln -s /etc/plex/service.plex.run /etc/services.d/plex/run +mkdir -p /etc/cont-init.d +ln -s /etc/plex/plex-first-run /etc/cont-init.d/000-plex-first-run +ln -s /etc/plex/plex-hw-transcode-and-connected-tuner /etc/cont-init.d/010-plex-hw-transcode-and-connected-tuner +if [ -n "${URL}" ]; then echo "Attempting to install from URL: ${URL}" installFromRawUrl "${URL}" -elif [ "${TAG}" != "beta" ] && [ "${TAG}" != "public" ]; then - getVersionInfo "${TAG}" "" remoteVersion remoteFile +elif [ "${TAG,,}" = "autoupdate" ] || [ "${TAG,,}" = "beta" ] || [ "${TAG,,}" = "public" ]; then + echo "AUTOUPDATE requested, skipping download and install, setting up cron service and scheduling plex-update" + mkdir -p /etc/services.d/cron ; ln -s /etc/plex/service.cron.run /etc/services.d/cron/run + # Specify bash as shell, add S6 commands to PATH + echo "SHELL=/bin/bash" > /etc/crontab + echo "$(env | grep PATH):/command" >> /etc/crontab + # Specify cron job: be nice to Plex servers - space out updates at 4:00am over 30m window + echo "0 4 * * * root perl -le 'sleep rand 1800' ; /etc/plex/plex-update > /proc/1/fd/1 2>&1" >> /etc/crontab + echo "Adding plex-startup to cont-init.d" + ln -s /etc/plex/plex-startup /etc/cont-init.d/099-plex-startup +else + # This pre-installs the specified version in TAG into this docker image. + remoteVersion= + remoteFile= + remoteFileHashSha256= + getVersionInfo "${TAG}" "" remoteVersion remoteFile remoteFileHashSha256 if [ -z "${remoteVersion}" ] || [ -z "${remoteFile}" ]; then echo "Could not get install version" @@ -18,5 +47,5 @@ elif [ "${TAG}" != "beta" ] && [ "${TAG}" != "public" ]; then fi echo "Attempting to install: ${remoteVersion}" - installFromUrl "${remoteFile}" + installFromUrl "${remoteFile}" "${remoteFileHashSha256}" fi diff --git a/root/plex-common.sh b/root/plex-common.sh index 9c41132e..6ac98ce5 100755 --- a/root/plex-common.sh +++ b/root/plex-common.sh @@ -1,21 +1,26 @@ #!/bin/bash +set -euo pipefail +IFS=$'\n\t' + +PLEX_UPDATE_CHANNEL=${PLEX_UPDATE_CHANNEL:-} CONT_CONF_FILE="/version.txt" function addVarToConf { local variable="$1" local value="$2" - if [ ! -z "${variable}" ]; then - echo ${variable}=${value} >> ${CONT_CONF_FILE} + if [ -n "${variable}" ]; then + echo "$variable"="$value" >> $CONT_CONF_FILE fi } function readVarFromConf { local variable="$1" local -n readVarFromConf_value=$2 - if [ ! -z "${variable}" ]; then - readVarFromConf_value="$(grep -w ${variable} ${CONT_CONF_FILE} | cut -d'=' -f2 | tail -n 1)" + if [ -n "${variable}" ]; then + readVarFromConf_value="$(grep -w "$variable" $CONT_CONF_FILE | cut -d'=' -f2 | tail -n 1)" else + # shellcheck disable=SC2034 readVarFromConf_value=NULL fi } @@ -25,10 +30,11 @@ function getVersionInfo { local token="$2" local -n getVersionInfo_remoteVersion=$3 local -n getVersionInfo_remoteFile=$4 + local -n getVersionInfo_remoteFileHashSha256=$5 - local channel + local channel= local tokenNeeded=1 - if [ ! -z "${PLEX_UPDATE_CHANNEL}" ] && [ "${PLEX_UPDATE_CHANNEL}" > 0 ]; then + if [ -n "${PLEX_UPDATE_CHANNEL}" ] && [ "${PLEX_UPDATE_CHANNEL}" -gt 0 ]; then channel="${PLEX_UPDATE_CHANNEL}" elif [ "${version,,}" = "beta" ]; then channel=8 @@ -40,6 +46,8 @@ function getVersionInfo { fi # Read container architecture info from file created when building Docker image + local plexBuild= + local plexDistro= readVarFromConf "plex_build" plexBuild readVarFromConf "plex_distro" plexDistro @@ -48,29 +56,61 @@ function getVersionInfo { url="${url}&X-Plex-Token=${token}" fi - local versionInfo="$(curl -s "${url}")" + local versionInfo= + versionInfo="$(curl -s "${url}")" # Get update info from the XML. Note: This could countain multiple updates when user specifies an exact version with the lowest first, so we'll use first always. + # shellcheck disable=SC2034 getVersionInfo_remoteVersion=$(echo "${versionInfo}" | sed -n 's/.*Release.*version="\([^"]*\)".*/\1/p') + # shellcheck disable=SC2034 getVersionInfo_remoteFile=$(echo "${versionInfo}" | sed -n 's/.*file="\([^"]*\)".*/\1/p') + # shellcheck disable=SC2034 + getVersionInfo_remoteFileHashSha256=$(echo "${versionInfo}" | sed -n 's/.*fileHashSha256="\([^"]*\)".*/\1/p') } function installFromUrl { - installFromRawUrl "https://plex.tv/${1}" + installFromRawUrl "https://plex.tv/${1}" "${2:-}" } function installFromRawUrl { local remoteFile="$1" - curl -J -L -o /tmp/plexmediaserver.deb "${remoteFile}" - local last=$? + local expectedSha256="${2:-}" + + rm -rf /tmp/plexmediaserver.deb + if curl --create-dirs -J -L -o /tmp/plexmediaserver.deb "${remoteFile}" ; then + if [ -n "$expectedSha256" ]; then + sha256=$(sha256sum /tmp/plexmediaserver.deb | awk '{ print $1 }') + # compare sha256, if provided + if [ ! "$expectedSha256" = "$sha256" ]; then + cleanup "Download failed: sha256sum does not match: expected=$expectedSha256 actual=$sha256" + fi + else + # no sha256, check if size appears ok + if [[ $(stat -c %s /tmp/plexmediaserver.deb) -lt 10000 ]]; then + # shellcheck disable=SC2119 + cleanup "Download failed: size appears wrong" + fi + fi + # looks good, move tmp into position - # test if deb file size is ok, or if download failed - if [[ "$last" -gt "0" ]] || [[ $(stat -c %s /tmp/plexmediaserver.deb) -lt 10000 ]]; then - echo "Failed to fetch update" - exit 1 + install "$remoteFile" + else + # shellcheck disable=SC2119 + cleanup fi +} + +function cleanup { + local msg="${1:-"Download failed"}" + rm -rf /tmp/plexmediaserver.deb + echo "$msg" + exit 1 +} - dpkg -i --force-confold --force-architecture /tmp/plexmediaserver.deb - rm -f /tmp/plexmediaserver.deb +function install { + dpkg -i --force-confold /tmp/plexmediaserver.deb + rm -rf /tmp/plexmediaserver.deb + # clean up _force_ flag, if exists + rm -rf /config/_force_ } diff --git a/root/plex-envvars b/root/plex-envvars new file mode 100755 index 00000000..be60fa58 --- /dev/null +++ b/root/plex-envvars @@ -0,0 +1,14 @@ +#!/bin/bash +set -euo pipefail +IFS=$'\n\t' + +home=~plex +model=$(uname -m) +version=$(uname -r) +export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR:-${home}/Library/Application Support}" +export PLEX_MEDIA_SERVER_HOME=/usr/lib/plexmediaserver +export PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6 +export PLEX_MEDIA_SERVER_INFO_VENDOR=Docker +export PLEX_MEDIA_SERVER_INFO_DEVICE="Docker Container" +export PLEX_MEDIA_SERVER_INFO_MODEL="$model" +export PLEX_MEDIA_SERVER_INFO_PLATFORM_VERSION="$version" diff --git a/root/plex-logs.sh b/root/plex-logs.sh new file mode 100755 index 00000000..b85f9d3b --- /dev/null +++ b/root/plex-logs.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +. /plex-envvars + +logs="$PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR/Plex Media Server/Logs" +multitail --mergeall "$logs"/* + diff --git a/root/plex-service.sh b/root/plex-service.sh new file mode 100755 index 00000000..e400acb7 --- /dev/null +++ b/root/plex-service.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +if [ "$#" -eq 1 ]; then + s6-svc "$1" /var/run/s6/services/plex +else + echo "No argument supplied; must be -u (bring up), -d (bring down), or -r (restart)." +fi diff --git a/root/plex_service.sh b/root/plex_service.sh deleted file mode 100755 index 882e40c4..00000000 --- a/root/plex_service.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -if [ "$#" -eq 1 ]; then - s6-svc "$1" /var/run/s6/services/plex -else - echo "No argument supplied; must be -u, -d, or -r." -fi