From 7ad011e8e6fa21078557edee41f7e08eea40ba69 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Wed, 9 Feb 2022 19:57:36 +0100 Subject: [PATCH] Create 00-data_location.sj --- .../rootfs/etc/cont-init.d/00-data_location.sj | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 jellyfin/rootfs/etc/cont-init.d/00-data_location.sj diff --git a/jellyfin/rootfs/etc/cont-init.d/00-data_location.sj b/jellyfin/rootfs/etc/cont-init.d/00-data_location.sj new file mode 100644 index 000000000..e5c3145ed --- /dev/null +++ b/jellyfin/rootfs/etc/cont-init.d/00-data_location.sj @@ -0,0 +1,15 @@ +#!/usr/bin/with-contenv bashio +PUID=$(bashio::config "PUID") +PGID=$(bashio::config "PGID") +LOCATION=$(bashio::config 'data_location') + +bashio::log.info "Setting data location to $LOCATION" +sed -i "s|/config|$LOCATION|g" /etc/services.d/jellyfin/run +sed -i "s|/config|$LOCATION|g" /etc/cont-init.d/10-adduser +sed -i "s|/config|$LOCATION|g" /etc/cont-init.d/30-config + +echo "Creating $LOCATION" +mkdir -p "$LOCATION" + +bashio::log.info "Setting ownership to $PUID:$GUID" +chown "$PUID":"$GUID" "$LOCATION"