From f182c5466ae33743b7c6eb16cebb5f96b60a4bc5 Mon Sep 17 00:00:00 2001 From: einhorn_b Date: Wed, 17 Jan 2024 14:34:07 +0100 Subject: [PATCH] create mysql user and password only of not already exist --- deployment/hetzner_cloud/install.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/deployment/hetzner_cloud/install.sh b/deployment/hetzner_cloud/install.sh index b83cdae68..ee539370c 100755 --- a/deployment/hetzner_cloud/install.sh +++ b/deployment/hetzner_cloud/install.sh @@ -112,9 +112,12 @@ cp $SCRIPT_PATH/logrotate/gradido.conf /etc/logrotate.d/gradido.conf # create db user export DB_USER=gradido -export DB_PASSWORD=$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-32};echo); +# create a new password only if it not already exist +if [ -z "${DB_PASSWORD}" ]; then + export DB_PASSWORD=$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-32};echo); +fi mysql <