From 1653e5e44ba27cc3fdc43e61bc7e0f8dd74798c0 Mon Sep 17 00:00:00 2001 From: anima Date: Fri, 7 Feb 2025 03:03:29 +0100 Subject: [PATCH] move api pass set to init only --- init.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/init.sh b/init.sh index 13c1519..af7f74f 100644 --- a/init.sh +++ b/init.sh @@ -43,14 +43,15 @@ if [ -z "$(ls -A /data)" ]; then echo '}' >> $ICINGA2_FILE_API_USER_CONF fi + + ## only on inital setup replace one time the api root user password if a env var is set + if [ ! -z "$ICINGA2_API_USER_ROOT_PASS" ]; then + echo set inital api root user password + sed -i "s|password = \".*\"|password = \"$ICINGA2_API_USER_ROOT_PASS\"|g" $ICINGA2_FILE_API_USER_CONF + fi fi -## only on inital setup replace one time the api root user password if a env var is set -if [ ! -z "$ICINGA2_API_USER_ROOT_PASS" ]; then - echo set inital api root user password - sed -i "s|password = \".*\"|password = \"$ICINGA2_API_USER_ROOT_PASS\"|g" $ICINGA2_FILE_API_USER_CONF -fi ## enable icingadb feature if not active