move api pass set to init only
Some checks failed
build container icinga2 / build (push) Has been cancelled

This commit is contained in:
2025-02-07 03:03:29 +01:00
parent 7a2c0f21ce
commit 1653e5e44b

11
init.sh
View File

@@ -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