add check to enable /setup deployment
All checks were successful
build container icingaweb2 / build (push) Successful in 3m54s
All checks were successful
build container icingaweb2 / build (push) Successful in 3m54s
This commit is contained in:
12
init.sh
12
init.sh
@@ -6,6 +6,7 @@ ICINGAWEB2_PORT=8080
|
|||||||
|
|
||||||
## init icinga config files if need
|
## init icinga config files if need
|
||||||
if [ -z "$(ls -A /data)" ]; then
|
if [ -z "$(ls -A /data)" ]; then
|
||||||
|
# enable python script for inital deployments
|
||||||
ICINGAWEB2_CONF_ONCE=false
|
ICINGAWEB2_CONF_ONCE=false
|
||||||
export INIT_DB=true
|
export INIT_DB=true
|
||||||
|
|
||||||
@@ -14,9 +15,17 @@ if [ -z "$(ls -A /data)" ]; then
|
|||||||
cp -ax /data-init/* /data
|
cp -ax /data-init/* /data
|
||||||
rm -rf /data-init
|
rm -rf /data-init
|
||||||
|
|
||||||
|
## check if a var exist they is must have for deployment
|
||||||
|
## because without this check, moduls init everytime and this blocks /setup page
|
||||||
|
if [ ! -z "$ICINGAWEB2_DEFAULT_ADMIN_USER" ]; then
|
||||||
## enable modules
|
## enable modules
|
||||||
icingacli module enable icingadb
|
icingacli module enable icingadb
|
||||||
mkdir -p /etc/icingaweb2/modules/icingadb/
|
mkdir -p /etc/icingaweb2/modules/icingadb/
|
||||||
|
|
||||||
|
else
|
||||||
|
## print setup token because no auto deployment will run
|
||||||
|
icingacli setup token create;
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
## apache setup
|
## apache setup
|
||||||
@@ -27,7 +36,8 @@ if [ ! -z "$ICINGAWEB2_PORT" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
## edit icingaweb2 config only on first setup or is enabled
|
## edit icingaweb2 config only on first setup or is enabled
|
||||||
if [ ! $ICINGAWEB2_CONF_ONCE ] || [ "$ICINGAWEB2_CONF_ONCE" = false ]; then
|
if { [ -z "${ICINGAWEB2_CONF_ONCE+x}" ] || [ "$ICINGAWEB2_CONF_ONCE" = "false" ]; } \
|
||||||
|
&& [ -n "${ICINGAWEB2_DEFAULT_ADMIN_USER+x}" ]; then
|
||||||
/usr/bin/python3 /root/conf_icingaweb2.py
|
/usr/bin/python3 /root/conf_icingaweb2.py
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user