From 999460677259d20025d2b021e3c7ed40585f0141 Mon Sep 17 00:00:00 2001 From: Christoph Date: Sat, 4 Dec 2021 13:25:35 +0100 Subject: [PATCH] add_missing_indices.sh: check if database parameter's are given.. --- add_missing_indices.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/add_missing_indices.sh b/add_missing_indices.sh index be70042..5ea4353 100755 --- a/add_missing_indices.sh +++ b/add_missing_indices.sh @@ -276,6 +276,24 @@ fi [[ -n "$PHP_ENGINE" ]] || PHP_ENGINE=$DEFAULT_PHP_ENGINE +if [[ "$DATABASE_TYPE" != "postgres" ]] && [[ "$DATABASE_TYPE" != "mysql" ]]; then + fatal "Wrong or missing database type (parameter 'DATABASE_TYPE')" +fi + +if [[ -z "$DATABASE_NAME" ]]; then + fatal "Missing database name (parameter 'DATABASE_NAME')" +fi + +if [[ "$DATABASE_TYPE" = "mysql" ]] && [[ -z "$MYSQL_CREDENTIALS" ]]; then + fatal "No Database Credentials for MySQL given (parameter 'MYSQL_CREDENTIALS')" +fi + +if [[ "$DATABASE_TYPE" = "postgres" ]]; then + if [[ -z "$PSQL_USER" ]] || [[ -z "$PSQL_PASS" ]]; then + fatal "No Database Credentials for PostgreSQL given (parameters: 'PSQL_USER' 'PSQL_PASS'" + fi +fi + NGINX_IS_ENABLED=false APACHE2_IS_ENABLED=false