forced configsource

This commit is contained in:
Alexandre
2022-04-12 20:58:59 +02:00
committed by GitHub
parent 278a861d8e
commit 0273c9a592

View File

@@ -1,18 +1,17 @@
#!/usr/bin/env bashio
# shellcheck shell=bash
CONFIGSOURCE=$(bashio::config "CONFIG_LOCATION")
CONFIGSOURCE=$(dirname "$CONFIGSOURCE")
CONFIGSOURCE="/config/addons_config/fireflyiii_fints_importer"
# Create directory
mkdir -p "$CONFIGSOURCE"
# If no file, provide example
[ ! "$(ls -A "${CONFIGSOURCE}")" ] && cp -rn /app/data/configurations/* "$CONFIGSOURCE"/
[ ! "$(ls -A "${CONFIGSOURCE}")" ] && cp -rn /app/configurations/* "$CONFIGSOURCE"/
# Create symlinks
rm -r /app/data/configurations
ln -sf "$CONFIGSOURCE" /app/data/configurations
rm -r /app/configurations
ln -sf "$CONFIGSOURCE" /app/configurations
# Make sure permissions are right
chown -R "$(id -u):$(id -g)" "$CONFIGSOURCE"