move root api pw set before other users
All checks were successful
build container icinga2 / build (push) Successful in 2m12s

This commit is contained in:
2025-02-07 03:04:17 +01:00
parent 1653e5e44b
commit ee48ad39dd

11
init.sh
View File

@@ -23,6 +23,12 @@ if [ -z "$(ls -A /data)" ]; then
mv $ICINGA2_CONF_DIR/*.conf $ICINGA2_GLOBAL_TEMPLATES/
mv $ICINGA2_GLOBAL_TEMPLATES/api-users.conf $ICINGA2_CONF_DIR/
## 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
## only on inital setup create a icingaweb api user if env var is set
## permission source: https://icinga.com/docs/icinga-web/latest/modules/monitoring/doc/05-Command-Transports/
if [ ! -z "$ICINGA2_API_USER_ICINGAWEB_PASS" ]; then
@@ -44,11 +50,6 @@ if [ -z "$(ls -A /data)" ]; then
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