diff --git a/scripts/ofelia-config.sh b/scripts/ofelia-config.sh index bb3cad9..5a4194c 100755 --- a/scripts/ofelia-config.sh +++ b/scripts/ofelia-config.sh @@ -24,9 +24,9 @@ if test -z "${output_path}"; then output_path=/dev/stdout; fi -for entry in "${BACKUP_DATABASES}"; do +echo "${BACKUP_DATABASES}" | while read entry; do # normalize spaces - backup_data=$(echo ${entry} | xargs); + backup_data=$(echo "${entry}" | xargs); # skip if it is a empty line if test -z "${backup_data}"; then continue; @@ -36,7 +36,7 @@ for entry in "${BACKUP_DATABASES}"; do # remove everything before the first space to get cron label BACKUP_SCHEDULE=${backup_data#* }; # load url data as variables - dburl-parser.sh ${DB_URL} > /tmp/ofelia.dotenv; + dburl-parser.sh ${DB_URL} > /tmp/ofelia.dotenv || exit 1; source /tmp/ofelia.dotenv; rm /tmp/ofelia.dotenv; # fail if $DB_URL has no schema