Files
hassio-addons/fireflyiii_fints_importer/rootfs/etc/cont-init.d/20-folders.sh
2022-04-12 20:58:59 +02:00

18 lines
438 B
Bash

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