fix: loop through lines on multiline database url set
This commit is contained in:
@@ -24,9 +24,9 @@ if test -z "${output_path}"; then
|
|||||||
output_path=/dev/stdout;
|
output_path=/dev/stdout;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for entry in "${BACKUP_DATABASES}"; do
|
echo "${BACKUP_DATABASES}" | while read entry; do
|
||||||
# normalize spaces
|
# normalize spaces
|
||||||
backup_data=$(echo ${entry} | xargs);
|
backup_data=$(echo "${entry}" | xargs);
|
||||||
# skip if it is a empty line
|
# skip if it is a empty line
|
||||||
if test -z "${backup_data}"; then
|
if test -z "${backup_data}"; then
|
||||||
continue;
|
continue;
|
||||||
@@ -36,7 +36,7 @@ for entry in "${BACKUP_DATABASES}"; do
|
|||||||
# remove everything before the first space to get cron label
|
# remove everything before the first space to get cron label
|
||||||
BACKUP_SCHEDULE=${backup_data#* };
|
BACKUP_SCHEDULE=${backup_data#* };
|
||||||
# load url data as variables
|
# 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;
|
source /tmp/ofelia.dotenv;
|
||||||
rm /tmp/ofelia.dotenv;
|
rm /tmp/ofelia.dotenv;
|
||||||
# fail if $DB_URL has no schema
|
# fail if $DB_URL has no schema
|
||||||
|
|||||||
Reference in New Issue
Block a user