mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-12 02:21:28 +02:00
Adjust photoprism migration marker
This commit is contained in:
@@ -12,6 +12,8 @@ fi
|
||||
|
||||
bashio::log.info "Preparing scripts"
|
||||
echo "... creating structure"
|
||||
CONFIG_DIR="$(dirname "$(bashio::config "CONFIG_LOCATION")")"
|
||||
mkdir -p "$CONFIG_DIR"
|
||||
mkdir -p \
|
||||
/data/photoprism/originals \
|
||||
/data/photoprism/import \
|
||||
@@ -23,6 +25,8 @@ echo "... setting permissions"
|
||||
chmod -R 777 /data/photoprism
|
||||
chown -Rf photoprism:photoprism /data/photoprism
|
||||
chmod -Rf a+rwx /data/photoprism
|
||||
chmod -R 777 "$CONFIG_DIR"
|
||||
chown -Rf photoprism:photoprism "$CONFIG_DIR"
|
||||
for line in BACKUP_PATH IMPORT_PATH ORIGINALS_PATH STORAGE_PATH; do
|
||||
mkdir -p "$line"
|
||||
chmod -R 777 "$line"
|
||||
|
||||
16
photoprism/rootfs/etc/cont-init.d/01-migrate.sh
Normal file
16
photoprism/rootfs/etc/cont-init.d/01-migrate.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
set -e
|
||||
|
||||
slug=photoprism
|
||||
|
||||
if [ -d "/homeassistant/addons_config/$slug" ]; then
|
||||
echo "Migrating /homeassistant/addons_config/$slug to /addon_configs/xxx-$slug"
|
||||
cp -rnf /homeassistant/addons_config/"$slug"/. /config/ || true
|
||||
echo "Migrated to internal config folder accessible at /addon_configs/xxx-$slug" \
|
||||
> "/homeassistant/addons_config/$slug/.migrate"
|
||||
fi
|
||||
|
||||
if [ -d /config/addons_config ]; then
|
||||
rm -rf /config/addons_config
|
||||
fi
|
||||
Reference in New Issue
Block a user