From 6b36634769fff21849996171db29a5a915a6aab9 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Sat, 5 Feb 2022 20:13:47 +0100 Subject: [PATCH] Update 99-run.sh --- .../rootfs/etc/cont-init.d/99-run.sh | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/fireflyiii_data_importer/rootfs/etc/cont-init.d/99-run.sh b/fireflyiii_data_importer/rootfs/etc/cont-init.d/99-run.sh index ecac3c69a..fd5e446e2 100644 --- a/fireflyiii_data_importer/rootfs/etc/cont-init.d/99-run.sh +++ b/fireflyiii_data_importer/rootfs/etc/cont-init.d/99-run.sh @@ -6,7 +6,7 @@ CONFIGSOURCE=$(bashio::config "CONFIG_LOCATION") # CONFIG IMPORT # ################# -if [ $(ls -A $CONFIGSOURCE/configurations) ]; then +if [ $(ls -A "$CONFIGSOURCE/configurations") ]; then bashio::log.info "Configurations were found in $CONFIGSOURCE/configurations, they will be loaded." JSON_CONFIGURATION_DIR="$CONFIGSOURCE/configurations" export JSON_CONFIGURATION_DIR @@ -18,9 +18,7 @@ fi if bashio::config.has_value 'Updates'; then - CONFIGSOURCE="$(dirname "${CONFIGSOURCE}/import_files")" - - if [ $(ls -A $CONFIGSOURCE) ]; then + if [ "$(ls -A ${CONFIGSOURCE}/import_files)" ]; then # Align update with options echo "" FREQUENCY=$(bashio::config 'Updates') @@ -38,18 +36,18 @@ if bashio::config.has_value 'Updates'; then service cron start # Export variables - IMPORT_DIR_WHITELIST="$CONFIGSOURCE" + IMPORT_DIR_WHITELIST="${CONFIGSOURCE}/import_files" export IMPORT_DIR_WHITELIST - bashio::log.info "Automatic updates were requested. The files in $CONFIGSOURCE will be imported $FREQUENCY." + bashio::log.info "Automatic updates were requested. The files in ${CONFIGSOURCE}/import_files will be imported $FREQUENCY." else - bashio::log.fatal "Automatic updates were requested, but there are no configuration files in $CONFIGSOURCE. There will therefore be be no automatic updates." + bashio::log.fatal "Automatic updates were requested, but there are no configuration files in ${CONFIGSOURCE}/import_files. There will therefore be be no automatic updates." fi else - bashio::log.info "Automatic updates not set in addon config. If you add configuration files in $CONFIGSOURCE, they won't be automatically updated." + bashio::log.info "Automatic updates not set in addon config. If you add configuration files in ${CONFIGSOURCE}/import_files, they won't be automatically updated." fi