diff --git a/.assets/hotio-striptracks-synology.png b/.assets/hotio-striptracks-synology.png deleted file mode 100644 index 2439429..0000000 Binary files a/.assets/hotio-striptracks-synology.png and /dev/null differ diff --git a/README.md b/README.md index 6c0d004..907ee4a 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ # About A [Docker Mod](https://github.com/linuxserver/docker-mods) for the LinuxServer.io Radarr/Sonarr v3 or higher Docker containers that adds a script to automatically strip out unwanted audio and subtitle tracks, keeping only the desired languages. -**NEW!** There is a now an installer for **hotio** containers! See the [HOTIO.md](./hotio/HOTIO.md) file for more details. - **This unified script works in both Radarr and Sonarr. Use this mod in either container!** >**NOTE:** This mod supports Linux OSes only. diff --git a/hotio/99-striptracks.sh b/hotio/99-striptracks.sh deleted file mode 100644 index a8c33f3..0000000 --- a/hotio/99-striptracks.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/command/with-contenv bash -# shellcheck shell=bash - -# Custom script to install Striptracks Mod meant for Radarr or Sonarr Docker containers -# WARNING: Minimal error handling! - -# Pre-set LSIO Docker Mod variables -DOCKER_MODS=linuxserver/mods:radarr-striptracks -#DOCKER_MODS_DEBUG=true -export DOCKER_MODS -export DOCKER_MODS_DEBUG -[ "$DOCKER_MODS_DEBUG" = "true" ] && echo "[mod-install] DOCKER_MODS: $DOCKER_MODS" && echo "[mod-install] DOCKER_MODS_DEBUG: $DOCKER_MODS_DEBUG" -echo "[mod-install] installing $DOCKER_MODS mod" - -# Steal the current docker-mods version from the source -MODS_VERSION=$(curl -s --fail-with-body "https://raw.githubusercontent.com/linuxserver/docker-baseimage-alpine/master/Dockerfile" | sed -nr 's/^ARG MODS_VERSION="?([^"]+)"?/\1/p') -[ "$DOCKER_MODS_DEBUG" = "true" ] && echo "[mod-install] MODS_VERSION: $MODS_VERSION" - -# Download and execute the main docker-mods script to install the mod -# Very well thought out code, this. Why reinvent? -curl -s --fail-with-body -o /docker-mods "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/docker-mods.${MODS_VERSION}" -ret=$? -[ $ret -ne 0 ] && echo "[mod-install] unable to download docker-mods: Exit code: $ret. Exiting." && exit 1 - -chmod +x /docker-mods - -. /docker-mods -[ $ret -ne 0 ] && echo "[mod-install] docker-mods installation error: $ret. Exiting." && exit 1 - -# Get script version from installed mod -VERSION=$(sed -nr 's/^export striptracks_ver="?([^"]+)"?/\1/p' /usr/local/bin/striptracks.sh) -[ "$DOCKER_MODS_DEBUG" = "true" ] && echo "[mod-install] striptracks.sh version: $VERSION" - -# Remaining setup that is normally done with s6-overlay init scripts, but that rely on a lot of Docker Mods dependencies -cat <>> Striptracks Mod by TheCaptain989 <<< -Repos: - Dev/test: https://github.com/TheCaptain989/radarr-striptracks - Prod: https://github.com/linuxserver/docker-mods/tree/radarr-striptracks - -Version: ${VERSION} ----------------- -EOF - -# Determine if setup is needed -if [ ! -f /usr/bin/mkvmerge ]; then - echo "[mod-install] Running first time setup." - - if [ -f /usr/bin/apt ]; then - # Ubuntu - echo "[mod-install] Installing MKVToolNix using apt-get" - apt-get update && \ - apt-get -y install mkvtoolnix && \ - rm -rf /var/lib/apt/lists/* - elif [ -f /sbin/apk ]; then - # Alpine - echo "[mod-install] Installing MKVToolNix using apk" - apk upgrade --no-cache && \ - apk add --no-cache mkvtoolnix && \ - rm -rf /var/lib/apt/lists/* - else - # Unknown - echo "[mod-install] Unknown package manager. Attempting to install MKVToolNix using apt-get" - apt-get update && \ - apt-get -y install mkvtoolnix && \ - rm -rf /var/lib/apt/lists/* - fi -fi - -# Check ownership and attributes on each script file -[ -z "$PUID" ] && owner_user="root" || owner_user="$PUID" -[ -z "$PGID" ] && owner_group="root" || owner_group="$PGID" -for file in /usr/local/bin/striptracks*.sh -do - # Change ownership - if [ "$(stat -c '%G' "$file")" != "$owner_group" ]; then - echo "[mod-install] Changing ownership on $file script to $owner_user:$owner_group." - chown "$owner_user":"$owner_group" "$file" - fi - - # Make executable - if [ ! -x "$file" ]; then - echo "[mod-install] Making $file script executable." - chmod +x "$file" - fi -done diff --git a/hotio/HOTIO.md b/hotio/HOTIO.md deleted file mode 100644 index 2e23cea..0000000 --- a/hotio/HOTIO.md +++ /dev/null @@ -1,86 +0,0 @@ -# About -This mod can now be used with [hotio](https://hotio.dev/) containers by using the method described in the hotio [FAQ](https://hotio.dev/faq/#:~:text=I%20would%20like%20to%20execute%20my%20own%20scripts%20on%20startup%2C%20how%20would%20I%20do%20this%3F) to install it. -(This method relies on s6-overlay v2 behavior still working, though v3 is the current version.) - ->This is a quick and dirty script with minimal testing or error checking. Note that it only runs *inside* the hotio container. - -# Installation -1. Download the **[99-striptracks.sh](./99-striptracks.sh)** install script and save it somewhere that can be mounted by your container. - - *Example location:* `/volume1/docker/99-striptracks.sh` - - *Example curl line to download the installation script:* - - ```shell - curl -s https://raw.githubusercontent.com/TheCaptain989/radarr-striptracks/master/hotio/99-striptracks.sh >/volume1/docker/99-striptracks.sh - ``` - -2. Make it executable: - - ```shell - chmod +x /volume1/docker/99-striptracks.sh - ``` - -3. Pull your selected container ([hotio/radarr](https://github.com/orgs/hotio/packages/container/package/radarr "hotio's Radarr container") or [hotio/sonarr](https://github.com/orgs/hotio/packages/container/package/sonarr "hotio.io's Sonarr container")) from GitHub Container Registry or Docker Hub: - `docker pull ghcr.io/hotio/radarr:latest` OR - `docker pull ghcr.io/hotio/sonarr:latest` - -4. Configure the Docker container with all the port, volume, and environment settings from the *original container documentation* here: - **[hotio/radarr](https://hotio.dev/containers/radarr/ "Radarr Docker container")** - **[hotio/sonarr](https://hotio.dev/containers/sonarr/ "Sonarr Docker container")** - - >**Note:** Notice that no environment variables are used in this setup. That is a specific feature of LSIO containers and is not applicable to hotio containers. - - 1. Add the **99-striptracks.sh** file path as a mount point in your `compose.yml` file or `docker run` command. - >**Note:** The `/etc/cont-init.d/99-striptracks` path below is important; don't change it! - - *Example Docker Compose YAML Configuration* - - ```yaml - services: - sonarr: - container_name: sonarr - image: ghcr.io/hotio/sonarr - ports: - - "8989:8989" - environment: - - PUID=1000 - - PGID=1000 - - UMASK=002 - - TZ=Etc/UTC - volumes: - - /:/config - - /:/data - - /volume1/docker/99-striptracks.sh:/etc/cont-init.d/99-striptracks - ``` - - *Example Docker Run Command* - - ```shell - docker run --rm \ - --name sonarr \ - -p 8989:8989 \ - -e PUID=1000 \ - -e PGID=1000 \ - -e UMASK=002 \ - -e TZ="Etc/UTC" \ - -v /:/config \ - -v /:/data \ - -v /volume1/docker/99-striptracks.sh:/etc/cont-init.d/99-striptracks \ - ghcr.io/hotio/sonarr - ``` - - *Example Synology Configuration* - ![striptracks hotio](../.assets/hotio-striptracks-synology.png "Synology container settings") - - >**Note:** Please be sure that your mount points for `/config` and `/data` above do not overlap with the newly added mount point! - - 2. Start the container. - -5. After the container has fully started, continue with Installation step 3 in the previous [README](../README.md#installation). - -## Requirements -You must have the **bash** shell available in your host path. You *might* attempt editing the [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)) in the 99-striptracks.sh script to get around this, but that is beyond the scope of this document. - -## Known Problems -On at least *some* Synology hosts that use the ash shell, this script will cause the container to abort and not start. If this happens, ***check your container logs*** for hints as to what may be wrong.