mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-10 09:51:02 +01:00
Migrate files to new /config
https://github.com/alexbelgium/hassio-addons/issues/1048?notification_referrer_id=NT_kwDOAqIdGbQxNDkxMzI0ODYwODo0NDE3ODcxMw#event-16395784949
This commit is contained in:
29
jellyfin/rootfs/etc/cont-init.d/01-migrate.sh
Normal file
29
jellyfin/rootfs/etc/cont-init.d/01-migrate.sh
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
set -e
|
||||
|
||||
slug=jellyfin
|
||||
|
||||
# Migration to new /config logic
|
||||
if [[ "$LOCATION" == "/config/addons_config/"* ]]; then
|
||||
bashio::log.warning "Data folder was $LOCATION, it is migrated to /config/data. The previous folder is renamed to _migrated"
|
||||
LOCATION="${LOCATION/config/homeassistant}"
|
||||
mkdir -p /config/data
|
||||
if [ -d $LOCATION ]; then
|
||||
cp -rf "$LOCATION"/* /config/data/
|
||||
mv "$LOCATION" "$LOCATION"_migrated
|
||||
fi
|
||||
bashio::addon.option "data_location" "/config/data"
|
||||
fi
|
||||
|
||||
# Migrate autoscripts
|
||||
if [ -f "/homeassistant/addons_autoscripts/$slug.sh" ]; then
|
||||
bashio::log.warning "Migrating autoscript"
|
||||
mv /homeassistant/addons_autoscripts/$slug.sh /config/ || true
|
||||
fi
|
||||
|
||||
# Migrate config.yaml
|
||||
if [ -f "/homeassistant/addons_config/$slug/config.yaml" ]; then
|
||||
bashio::log.warning "Migrating config.yaml"
|
||||
mv /homeassistant/addons_config/$slug/config.yaml /config/ || true
|
||||
fi
|
||||
Reference in New Issue
Block a user