fix: use random temporary file names in dburl dotenv

This commit is contained in:
2024-10-23 11:43:16 -03:00
parent a4083b67cf
commit 2134c5f965
2 changed files with 12 additions and 6 deletions

View File

@@ -21,9 +21,12 @@ DB_URL="$1";
# - $DB_PORT
# - $DB_NAME
# - any query var as a prefixed variable $db_arg_${name}=${value}
dburl-parser.sh ${DB_URL} > /tmp/ofelia.dotenv;
source /tmp/ofelia.dotenv;
rm /tmp/ofelia.dotenv;
dotenv_path="/tmp/ofelia-$(
tr -dc A-Za-z0-9 </dev/urandom | head -c 16; echo
).dotenv"
dburl-parser.sh ${DB_URL} > ${dotenv_path};
source ${dotenv_path};
rm ${dotenv_path};
# set backup destination
if test -z "${BACKUP_DATABASES_PATH}"; then