mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-08 08:35:57 +02:00
Update 00-data_location.sh
This commit is contained in:
@@ -1,8 +1,14 @@
|
|||||||
#!/usr/bin/with-contenv bashio
|
#!/usr/bin/with-contenv bashio
|
||||||
|
|
||||||
|
# Define user
|
||||||
PUID=$(bashio::config "PUID")
|
PUID=$(bashio::config "PUID")
|
||||||
PGID=$(bashio::config "PGID")
|
PGID=$(bashio::config "PGID")
|
||||||
LOCATION=$(bashio::config 'data_location')
|
|
||||||
|
|
||||||
|
# Check data location
|
||||||
|
LOCATION=$(bashio::config 'data_location')
|
||||||
|
if [[ "$LOCATION" = "null" || -z "$LOCATION" ]]; then LOCATION=/config/addons_config/${HOSTNAME#*-}; fi
|
||||||
|
|
||||||
|
# Set data location
|
||||||
bashio::log.info "Setting data location to $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/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/10-adduser
|
||||||
@@ -12,4 +18,4 @@ echo "Creating $LOCATION"
|
|||||||
mkdir -p "$LOCATION"
|
mkdir -p "$LOCATION"
|
||||||
|
|
||||||
bashio::log.info "Setting ownership to $PUID:$PGID"
|
bashio::log.info "Setting ownership to $PUID:$PGID"
|
||||||
chown "abc":"abc" "$LOCATION"
|
chown "$PUID":"$PGID" "$LOCATION"
|
||||||
|
|||||||
Reference in New Issue
Block a user