Update and rename 20-folders.sh to 20-migration_config.sh

This commit is contained in:
Alexandre
2024-03-28 15:31:13 +01:00
committed by GitHub
parent 2ece932731
commit cda99353ce
2 changed files with 19 additions and 15 deletions

View File

@@ -1,15 +0,0 @@
#!/usr/bin/env bashio
# shellcheck shell=bash
set -e
CONFIGSOURCE=$(bashio::config "CONFIG_LOCATION")
CONFIGSOURCE=$(dirname "$CONFIGSOURCE")
# Create directory
mkdir -p "$CONFIGSOURCE" || true
mkdir -p "$CONFIGSOURCE/import_files" || true
mkdir -p "$CONFIGSOURCE/configurations" || true
# Make sure permissions are right
chown -R "root:root" "$CONFIGSOURCE"
chmod -R 755 "$CONFIGSOURCE"

View File

@@ -0,0 +1,19 @@
#!/usr/bin/env bashio
# shellcheck shell=bash
set -e
slug=fireflyiii_data_importer
if [ -d "/homeassistant/addons_config/$slug" ]; then
echo "Migrating /homeassistant/addons_config/$slug"
mv /homeassistant/addons_config/"$slug"/* /config/ || true
rm -r /homeassistant/addons_config/"$slug"
fi
# Create directory
mkdir -p /config/import_files
mkdir -p /config/configurations
# Make sure permissions are right
chown -R "root:root" /config
chmod -R 755 /config