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:
parent
73099e8476
commit
13af901bca
@ -3078,7 +3078,7 @@ setup_mariadb() {
|
|||||||
|
|
||||||
function setup_mariadb_db() {
|
function setup_mariadb_db() {
|
||||||
if [[ -z "$DB_NAME" || -z "$DB_USER" ]]; then
|
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
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -3921,7 +3921,7 @@ function setup_postgresql_db() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Generate password if not provided
|
# 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)
|
DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user