Files
hassio-addons/fireflyiii_fints_importer/rootfs/etc/cont-init.d/20-folders.sh
2025-07-23 08:58:09 +00:00

27 lines
707 B
Bash
Executable File

#!/usr/bin/env bashio
# shellcheck shell=bash
set -e
CONFIGSOURCE="/config/addons_config/fireflyiii_fints_importer"
# Create directory
mkdir -p "$CONFIGSOURCE"
# If no file, provide example
if [ ! "$(ls -A "${CONFIGSOURCE}")" ] && [ -f /data/configurations ]; then
cp -r /data/configurations/* "$CONFIGSOURCE"/ || true
rm -r /data/configurations
fi
if [ ! "$(ls -A "${CONFIGSOURCE}")" ] && [ -f /app/configurations ]; then
cp -r /app/configurations/* "$CONFIGSOURCE"/ || true
rm -r /app/configurations
fi
ln -sf "$CONFIGSOURCE" /data/configurations
mkdir -p /app
ln -sf "$CONFIGSOURCE" /app/configurations
# Make sure permissions are right
chown -R "$(id -u):$(id -g)" "$CONFIGSOURCE"