#!/bin/sh # Sync image-baked plugins into the /config (datadir) plugins directory on every # start. /config is a PVC that overlays the image, so plugins baked into the # image are invisible until copied in here. Removing any existing versioned dir # of the same plugin first lets the image version win across restarts/downgrades. set -eu BAKED_DIR=/usr/share/jellyfin/plugins-baked PLUGIN_DIR=/config/plugins if [ -d "$BAKED_DIR" ]; then mkdir -p "$PLUGIN_DIR" for src in "$BAKED_DIR"/*; do [ -d "$src" ] || continue name=$(basename "$src") # e.g. "LDAP Authentication_22.0.0.0" base=${name%_*} # plugin name without the trailing _ for existing in "$PLUGIN_DIR/$base"_*; do [ -e "$existing" ] && rm -rf "$existing" done rm -rf "$PLUGIN_DIR/$name" cp -a "$src" "$PLUGIN_DIR/$name" done fi exec ./jellyfin \ --datadir /config \ --cachedir /cache \ --webdir /jellyfin/jellyfin-web \ "$@"