Improve error message and variable check in DB setup

Updated the error message in setup_mariadb_db to English for clarity. Improved the DB_PASS variable check in setup_postgresql_db to handle unset variables more robustly.
This commit is contained in:
CanbiZ 2025-11-10 13:23:36 +01:00
parent 73099e8476
commit 13af901bca

View File

@ -3078,7 +3078,7 @@ setup_mariadb() {
function setup_mariadb_db() {
if [[ -z "$DB_NAME" || -z "$DB_USER" ]]; then
msg_error "DB_NAME und DB_USER müssen gesetzt sein"
msg_error "DB_NAME and DB_USER must be set"
return 1
fi
@ -3921,7 +3921,7 @@ function setup_postgresql_db() {
fi
# Generate password if not provided
if [[ -z "$DB_PASS" ]]; then
if [[ -z "${DB_PASS:-}" ]]; then
DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
fi