From aa83b388943858c071e0e729c17ef813ac0d21da Mon Sep 17 00:00:00 2001 From: Alexey Pustovalov Date: Sat, 10 Apr 2021 00:02:09 -0400 Subject: [PATCH 1/4] Updated unsupported releases. Zabbix 3.0 --- snmptraps/alpine/README.md | 2 +- snmptraps/centos/README.md | 2 +- snmptraps/ubuntu/README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/snmptraps/alpine/README.md b/snmptraps/alpine/README.md index 35e120ef6..471da9d1d 100644 --- a/snmptraps/alpine/README.md +++ b/snmptraps/alpine/README.md @@ -48,7 +48,7 @@ Where `some-zabbix-snmptraps` is the name you want to assign to your container a ## Linking Zabbix server or Zabbix proxy with the container - docker run --name some-zabbix-server --link some-zabbix-snmptraps:zabbix-snmptraps --volumes-from some-zabbix-snmptraps -p 162:1162/udp -d zabbix/zabbix-server:tag + docker run --name some-zabbix-server --link some-zabbix-snmptraps:zabbix-snmptraps --volumes-from some-zabbix-snmptraps -d zabbix/zabbix-server:tag ## Container shell access and viewing Zabbix snmptraps logs diff --git a/snmptraps/centos/README.md b/snmptraps/centos/README.md index 35e120ef6..471da9d1d 100644 --- a/snmptraps/centos/README.md +++ b/snmptraps/centos/README.md @@ -48,7 +48,7 @@ Where `some-zabbix-snmptraps` is the name you want to assign to your container a ## Linking Zabbix server or Zabbix proxy with the container - docker run --name some-zabbix-server --link some-zabbix-snmptraps:zabbix-snmptraps --volumes-from some-zabbix-snmptraps -p 162:1162/udp -d zabbix/zabbix-server:tag + docker run --name some-zabbix-server --link some-zabbix-snmptraps:zabbix-snmptraps --volumes-from some-zabbix-snmptraps -d zabbix/zabbix-server:tag ## Container shell access and viewing Zabbix snmptraps logs diff --git a/snmptraps/ubuntu/README.md b/snmptraps/ubuntu/README.md index 35e120ef6..471da9d1d 100644 --- a/snmptraps/ubuntu/README.md +++ b/snmptraps/ubuntu/README.md @@ -48,7 +48,7 @@ Where `some-zabbix-snmptraps` is the name you want to assign to your container a ## Linking Zabbix server or Zabbix proxy with the container - docker run --name some-zabbix-server --link some-zabbix-snmptraps:zabbix-snmptraps --volumes-from some-zabbix-snmptraps -p 162:1162/udp -d zabbix/zabbix-server:tag + docker run --name some-zabbix-server --link some-zabbix-snmptraps:zabbix-snmptraps --volumes-from some-zabbix-snmptraps -d zabbix/zabbix-server:tag ## Container shell access and viewing Zabbix snmptraps logs From fe57f5c5e0b5244e3de7c1727bcaf7bbea163eeb Mon Sep 17 00:00:00 2001 From: Alexey Pustovalov Date: Sat, 10 Apr 2021 06:39:18 -0400 Subject: [PATCH 2/4] Added Zabbix agent 2 Ubuntu image --- .github/workflows/CI.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 585ac1074..8796f8845 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -50,8 +50,6 @@ jobs: exclude: - os: centos build: agent2 - - os: ubuntu - build: agent2 runs-on: ubuntu-20.04 steps: From d4bae351e84a2ae23d5f4fbc72741dd711d96254 Mon Sep 17 00:00:00 2001 From: Alexey Pustovalov Date: Sun, 11 Apr 2021 21:43:41 -0400 Subject: [PATCH 3/4] Ignore case for boolean vars --- agent/alpine/docker-entrypoint.sh | 6 +++--- agent/centos/docker-entrypoint.sh | 6 +++--- agent/ubuntu/docker-entrypoint.sh | 6 +++--- java-gateway/alpine/docker-entrypoint.sh | 2 +- java-gateway/centos/docker-entrypoint.sh | 2 +- java-gateway/ubuntu/docker-entrypoint.sh | 2 +- proxy-mysql/alpine/docker-entrypoint.sh | 16 ++++++++-------- proxy-mysql/centos/docker-entrypoint.sh | 16 ++++++++-------- proxy-mysql/ubuntu/docker-entrypoint.sh | 16 ++++++++-------- proxy-sqlite3/alpine/docker-entrypoint.sh | 6 +++--- proxy-sqlite3/centos/docker-entrypoint.sh | 6 +++--- proxy-sqlite3/ubuntu/docker-entrypoint.sh | 6 +++--- server-mysql/alpine/docker-entrypoint.sh | 16 ++++++++-------- server-mysql/centos/docker-entrypoint.sh | 16 ++++++++-------- server-mysql/ubuntu/docker-entrypoint.sh | 16 ++++++++-------- server-pgsql/alpine/docker-entrypoint.sh | 8 ++++---- server-pgsql/centos/docker-entrypoint.sh | 8 ++++---- server-pgsql/ubuntu/docker-entrypoint.sh | 8 ++++---- web-apache-mysql/alpine/docker-entrypoint.sh | 16 +++++++++------- web-apache-mysql/centos/docker-entrypoint.sh | 16 +++++++++------- web-apache-mysql/ubuntu/docker-entrypoint.sh | 16 +++++++++------- web-apache-pgsql/alpine/docker-entrypoint.sh | 8 +++++--- web-apache-pgsql/centos/docker-entrypoint.sh | 8 +++++--- web-apache-pgsql/ubuntu/docker-entrypoint.sh | 8 +++++--- web-nginx-mysql/alpine/docker-entrypoint.sh | 18 ++++++++++-------- web-nginx-mysql/centos/docker-entrypoint.sh | 18 ++++++++++-------- web-nginx-mysql/ubuntu/docker-entrypoint.sh | 18 ++++++++++-------- web-nginx-pgsql/alpine/docker-entrypoint.sh | 8 +++++--- web-nginx-pgsql/centos/docker-entrypoint.sh | 8 +++++--- web-nginx-pgsql/ubuntu/docker-entrypoint.sh | 8 +++++--- 30 files changed, 168 insertions(+), 144 deletions(-) diff --git a/agent/alpine/docker-entrypoint.sh b/agent/alpine/docker-entrypoint.sh index 32f56cc60..a31cbbb23 100755 --- a/agent/alpine/docker-entrypoint.sh +++ b/agent/alpine/docker-entrypoint.sh @@ -5,7 +5,7 @@ set -o pipefail set +e # Script trace mode -if [ "${DEBUG_MODE}" == "true" ]; then +if [ "${DEBUG_MODE,,}" == "true" ]; then set -o xtrace fi @@ -134,7 +134,7 @@ prepare_zbx_agent_config() { update_config_var $ZBX_AGENT_CONFIG "LogRemoteCommands" "${ZBX_LOGREMOTECOMMANDS}" : ${ZBX_PASSIVE_ALLOW:="true"} - if [ "$ZBX_PASSIVE_ALLOW" == "true" ]; then + if [ "${ZBX_PASSIVE_ALLOW,,}" == "true" ]; then echo "** Using '$ZBX_PASSIVESERVERS' servers for passive checks" update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVESERVERS}" else @@ -146,7 +146,7 @@ prepare_zbx_agent_config() { update_config_var $ZBX_AGENT_CONFIG "StartAgents" "${ZBX_STARTAGENTS}" : ${ZBX_ACTIVE_ALLOW:="true"} - if [ "$ZBX_ACTIVE_ALLOW" == "true" ]; then + if [ "${ZBX_ACTIVE_ALLOW,,}" == "true" ]; then echo "** Using '$ZBX_ACTIVESERVERS' servers for active checks" update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVESERVERS}" else diff --git a/agent/centos/docker-entrypoint.sh b/agent/centos/docker-entrypoint.sh index 32f56cc60..a31cbbb23 100755 --- a/agent/centos/docker-entrypoint.sh +++ b/agent/centos/docker-entrypoint.sh @@ -5,7 +5,7 @@ set -o pipefail set +e # Script trace mode -if [ "${DEBUG_MODE}" == "true" ]; then +if [ "${DEBUG_MODE,,}" == "true" ]; then set -o xtrace fi @@ -134,7 +134,7 @@ prepare_zbx_agent_config() { update_config_var $ZBX_AGENT_CONFIG "LogRemoteCommands" "${ZBX_LOGREMOTECOMMANDS}" : ${ZBX_PASSIVE_ALLOW:="true"} - if [ "$ZBX_PASSIVE_ALLOW" == "true" ]; then + if [ "${ZBX_PASSIVE_ALLOW,,}" == "true" ]; then echo "** Using '$ZBX_PASSIVESERVERS' servers for passive checks" update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVESERVERS}" else @@ -146,7 +146,7 @@ prepare_zbx_agent_config() { update_config_var $ZBX_AGENT_CONFIG "StartAgents" "${ZBX_STARTAGENTS}" : ${ZBX_ACTIVE_ALLOW:="true"} - if [ "$ZBX_ACTIVE_ALLOW" == "true" ]; then + if [ "${ZBX_ACTIVE_ALLOW,,}" == "true" ]; then echo "** Using '$ZBX_ACTIVESERVERS' servers for active checks" update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVESERVERS}" else diff --git a/agent/ubuntu/docker-entrypoint.sh b/agent/ubuntu/docker-entrypoint.sh index 32f56cc60..a31cbbb23 100755 --- a/agent/ubuntu/docker-entrypoint.sh +++ b/agent/ubuntu/docker-entrypoint.sh @@ -5,7 +5,7 @@ set -o pipefail set +e # Script trace mode -if [ "${DEBUG_MODE}" == "true" ]; then +if [ "${DEBUG_MODE,,}" == "true" ]; then set -o xtrace fi @@ -134,7 +134,7 @@ prepare_zbx_agent_config() { update_config_var $ZBX_AGENT_CONFIG "LogRemoteCommands" "${ZBX_LOGREMOTECOMMANDS}" : ${ZBX_PASSIVE_ALLOW:="true"} - if [ "$ZBX_PASSIVE_ALLOW" == "true" ]; then + if [ "${ZBX_PASSIVE_ALLOW,,}" == "true" ]; then echo "** Using '$ZBX_PASSIVESERVERS' servers for passive checks" update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVESERVERS}" else @@ -146,7 +146,7 @@ prepare_zbx_agent_config() { update_config_var $ZBX_AGENT_CONFIG "StartAgents" "${ZBX_STARTAGENTS}" : ${ZBX_ACTIVE_ALLOW:="true"} - if [ "$ZBX_ACTIVE_ALLOW" == "true" ]; then + if [ "${ZBX_ACTIVE_ALLOW,,}" == "true" ]; then echo "** Using '$ZBX_ACTIVESERVERS' servers for active checks" update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVESERVERS}" else diff --git a/java-gateway/alpine/docker-entrypoint.sh b/java-gateway/alpine/docker-entrypoint.sh index ec5223733..01ac14cd1 100755 --- a/java-gateway/alpine/docker-entrypoint.sh +++ b/java-gateway/alpine/docker-entrypoint.sh @@ -5,7 +5,7 @@ set -o pipefail set +e # Script trace mode -if [ "${DEBUG_MODE}" == "true" ]; then +if [ "${DEBUG_MODE,,}" == "true" ]; then set -o xtrace fi diff --git a/java-gateway/centos/docker-entrypoint.sh b/java-gateway/centos/docker-entrypoint.sh index ec5223733..01ac14cd1 100755 --- a/java-gateway/centos/docker-entrypoint.sh +++ b/java-gateway/centos/docker-entrypoint.sh @@ -5,7 +5,7 @@ set -o pipefail set +e # Script trace mode -if [ "${DEBUG_MODE}" == "true" ]; then +if [ "${DEBUG_MODE,,}" == "true" ]; then set -o xtrace fi diff --git a/java-gateway/ubuntu/docker-entrypoint.sh b/java-gateway/ubuntu/docker-entrypoint.sh index ec5223733..01ac14cd1 100755 --- a/java-gateway/ubuntu/docker-entrypoint.sh +++ b/java-gateway/ubuntu/docker-entrypoint.sh @@ -5,7 +5,7 @@ set -o pipefail set +e # Script trace mode -if [ "${DEBUG_MODE}" == "true" ]; then +if [ "${DEBUG_MODE,,}" == "true" ]; then set -o xtrace fi diff --git a/proxy-mysql/alpine/docker-entrypoint.sh b/proxy-mysql/alpine/docker-entrypoint.sh index 458b5283f..3d2794c41 100755 --- a/proxy-mysql/alpine/docker-entrypoint.sh +++ b/proxy-mysql/alpine/docker-entrypoint.sh @@ -5,7 +5,7 @@ set -o pipefail set +e # Script trace mode -if [ "${DEBUG_MODE}" == "true" ]; then +if [ "${DEBUG_MODE,,}" == "true" ]; then set -o xtrace fi @@ -150,17 +150,17 @@ check_variables_mysql() { file_env MYSQL_ROOT_PASSWORD - if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD}" == "true" ]; then + if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD,,}" == "true" ]; then echo "**** Impossible to use MySQL server because of unknown Zabbix user and random 'root' password" exit 1 fi - if [ ! -n "${MYSQL_USER}" ] && [ ! -n "${MYSQL_ROOT_PASSWORD}" ] && [ "${MYSQL_ALLOW_EMPTY_PASSWORD}" != "true" ]; then + if [ ! -n "${MYSQL_USER}" ] && [ ! -n "${MYSQL_ROOT_PASSWORD}" ] && [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" != "true" ]; then echo "*** Impossible to use MySQL server because 'root' password is not defined and it is not empty" exit 1 fi - if [ "${MYSQL_ALLOW_EMPTY_PASSWORD}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then + if [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then USE_DB_ROOT_USER=true DB_SERVER_ROOT_USER="root" DB_SERVER_ROOT_PASS=${MYSQL_ROOT_PASSWORD:-""} @@ -170,7 +170,7 @@ check_variables_mysql() { # If root password is not specified use provided credentials DB_SERVER_ROOT_USER=${DB_SERVER_ROOT_USER:-${MYSQL_USER}} - [ "${MYSQL_ALLOW_EMPTY_PASSWORD}" == "true" ] || DB_SERVER_ROOT_PASS=${DB_SERVER_ROOT_PASS:-${MYSQL_PASSWORD}} + [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || DB_SERVER_ROOT_PASS=${DB_SERVER_ROOT_PASS:-${MYSQL_PASSWORD}} DB_SERVER_ZBX_USER=${MYSQL_USER:-"zabbix"} DB_SERVER_ZBX_PASS=${MYSQL_PASSWORD:-"zabbix"} @@ -182,7 +182,7 @@ check_db_connect_mysql() { echo "* DB_SERVER_HOST: ${DB_SERVER_HOST}" echo "* DB_SERVER_PORT: ${DB_SERVER_PORT}" echo "* DB_SERVER_DBNAME: ${DB_SERVER_DBNAME}" - if [ "${DEBUG_MODE}" == "true" ]; then + if [ "${DEBUG_MODE,,}" == "true" ]; then if [ "${USE_DB_ROOT_USER}" == "true" ]; then echo "* DB_SERVER_ROOT_USER: ${DB_SERVER_ROOT_USER}" echo "* DB_SERVER_ROOT_PASS: ${DB_SERVER_ROOT_PASS}" @@ -321,7 +321,7 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "StartHTTPPollers" "${ZBX_STARTHTTPPOLLERS}" : ${ZBX_JAVAGATEWAY_ENABLE:="false"} - if [ "${ZBX_JAVAGATEWAY_ENABLE}" == "true" ]; then + if [ "${ZBX_JAVAGATEWAY_ENABLE,,}" == "true" ]; then update_config_var $ZBX_CONFIG "JavaGateway" "${ZBX_JAVAGATEWAY:-"zabbix-java-gateway"}" update_config_var $ZBX_CONFIG "JavaGatewayPort" "${ZBX_JAVAGATEWAYPORT}" update_config_var $ZBX_CONFIG "StartJavaPollers" "${ZBX_STARTJAVAPOLLERS:-"5"}" @@ -338,7 +338,7 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "VMwareTimeout" "${ZBX_VMWARETIMEOUT}" : ${ZBX_ENABLE_SNMP_TRAPS:="false"} - if [ "${ZBX_ENABLE_SNMP_TRAPS}" == "true" ]; then + if [ "${ZBX_ENABLE_SNMP_TRAPS,,}" == "true" ]; then update_config_var $ZBX_CONFIG "SNMPTrapperFile" "${ZABBIX_USER_HOME_DIR}/snmptraps/snmptraps.log" update_config_var $ZBX_CONFIG "StartSNMPTrapper" "1" else diff --git a/proxy-mysql/centos/docker-entrypoint.sh b/proxy-mysql/centos/docker-entrypoint.sh index 5b234b394..9f2450b43 100755 --- a/proxy-mysql/centos/docker-entrypoint.sh +++ b/proxy-mysql/centos/docker-entrypoint.sh @@ -5,7 +5,7 @@ set -o pipefail set +e # Script trace mode -if [ "${DEBUG_MODE}" == "true" ]; then +if [ "${DEBUG_MODE,,}" == "true" ]; then set -o xtrace fi @@ -150,17 +150,17 @@ check_variables_mysql() { file_env MYSQL_ROOT_PASSWORD - if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD}" == "true" ]; then + if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD,,}" == "true" ]; then echo "**** Impossible to use MySQL server because of unknown Zabbix user and random 'root' password" exit 1 fi - if [ ! -n "${MYSQL_USER}" ] && [ ! -n "${MYSQL_ROOT_PASSWORD}" ] && [ "${MYSQL_ALLOW_EMPTY_PASSWORD}" != "true" ]; then + if [ ! -n "${MYSQL_USER}" ] && [ ! -n "${MYSQL_ROOT_PASSWORD}" ] && [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" != "true" ]; then echo "*** Impossible to use MySQL server because 'root' password is not defined and it is not empty" exit 1 fi - if [ "${MYSQL_ALLOW_EMPTY_PASSWORD}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then + if [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then USE_DB_ROOT_USER=true DB_SERVER_ROOT_USER="root" DB_SERVER_ROOT_PASS=${MYSQL_ROOT_PASSWORD:-""} @@ -170,7 +170,7 @@ check_variables_mysql() { # If root password is not specified use provided credentials DB_SERVER_ROOT_USER=${DB_SERVER_ROOT_USER:-${MYSQL_USER}} - [ "${MYSQL_ALLOW_EMPTY_PASSWORD}" == "true" ] || DB_SERVER_ROOT_PASS=${DB_SERVER_ROOT_PASS:-${MYSQL_PASSWORD}} + [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || DB_SERVER_ROOT_PASS=${DB_SERVER_ROOT_PASS:-${MYSQL_PASSWORD}} DB_SERVER_ZBX_USER=${MYSQL_USER:-"zabbix"} DB_SERVER_ZBX_PASS=${MYSQL_PASSWORD:-"zabbix"} @@ -182,7 +182,7 @@ check_db_connect_mysql() { echo "* DB_SERVER_HOST: ${DB_SERVER_HOST}" echo "* DB_SERVER_PORT: ${DB_SERVER_PORT}" echo "* DB_SERVER_DBNAME: ${DB_SERVER_DBNAME}" - if [ "${DEBUG_MODE}" == "true" ]; then + if [ "${DEBUG_MODE,,}" == "true" ]; then if [ "${USE_DB_ROOT_USER}" == "true" ]; then echo "* DB_SERVER_ROOT_USER: ${DB_SERVER_ROOT_USER}" echo "* DB_SERVER_ROOT_PASS: ${DB_SERVER_ROOT_PASS}" @@ -321,7 +321,7 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "StartHTTPPollers" "${ZBX_STARTHTTPPOLLERS}" : ${ZBX_JAVAGATEWAY_ENABLE:="false"} - if [ "${ZBX_JAVAGATEWAY_ENABLE}" == "true" ]; then + if [ "${ZBX_JAVAGATEWAY_ENABLE,,}" == "true" ]; then update_config_var $ZBX_CONFIG "JavaGateway" "${ZBX_JAVAGATEWAY:-"zabbix-java-gateway"}" update_config_var $ZBX_CONFIG "JavaGatewayPort" "${ZBX_JAVAGATEWAYPORT}" update_config_var $ZBX_CONFIG "StartJavaPollers" "${ZBX_STARTJAVAPOLLERS:-"5"}" @@ -338,7 +338,7 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "VMwareTimeout" "${ZBX_VMWARETIMEOUT}" : ${ZBX_ENABLE_SNMP_TRAPS:="false"} - if [ "${ZBX_ENABLE_SNMP_TRAPS}" == "true" ]; then + if [ "${ZBX_ENABLE_SNMP_TRAPS,,}" == "true" ]; then update_config_var $ZBX_CONFIG "SNMPTrapperFile" "${ZABBIX_USER_HOME_DIR}/snmptraps/snmptraps.log" update_config_var $ZBX_CONFIG "StartSNMPTrapper" "1" else diff --git a/proxy-mysql/ubuntu/docker-entrypoint.sh b/proxy-mysql/ubuntu/docker-entrypoint.sh index 7f28723cc..9b949a8e3 100755 --- a/proxy-mysql/ubuntu/docker-entrypoint.sh +++ b/proxy-mysql/ubuntu/docker-entrypoint.sh @@ -5,7 +5,7 @@ set -o pipefail set +e # Script trace mode -if [ "${DEBUG_MODE}" == "true" ]; then +if [ "${DEBUG_MODE,,}" == "true" ]; then set -o xtrace fi @@ -150,17 +150,17 @@ check_variables_mysql() { file_env MYSQL_ROOT_PASSWORD - if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD}" == "true" ]; then + if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD,,}" == "true" ]; then echo "**** Impossible to use MySQL server because of unknown Zabbix user and random 'root' password" exit 1 fi - if [ ! -n "${MYSQL_USER}" ] && [ ! -n "${MYSQL_ROOT_PASSWORD}" ] && [ "${MYSQL_ALLOW_EMPTY_PASSWORD}" != "true" ]; then + if [ ! -n "${MYSQL_USER}" ] && [ ! -n "${MYSQL_ROOT_PASSWORD}" ] && [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" != "true" ]; then echo "*** Impossible to use MySQL server because 'root' password is not defined and it is not empty" exit 1 fi - if [ "${MYSQL_ALLOW_EMPTY_PASSWORD}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then + if [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then USE_DB_ROOT_USER=true DB_SERVER_ROOT_USER="root" DB_SERVER_ROOT_PASS=${MYSQL_ROOT_PASSWORD:-""} @@ -170,7 +170,7 @@ check_variables_mysql() { # If root password is not specified use provided credentials DB_SERVER_ROOT_USER=${DB_SERVER_ROOT_USER:-${MYSQL_USER}} - [ "${MYSQL_ALLOW_EMPTY_PASSWORD}" == "true" ] || DB_SERVER_ROOT_PASS=${DB_SERVER_ROOT_PASS:-${MYSQL_PASSWORD}} + [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || DB_SERVER_ROOT_PASS=${DB_SERVER_ROOT_PASS:-${MYSQL_PASSWORD}} DB_SERVER_ZBX_USER=${MYSQL_USER:-"zabbix"} DB_SERVER_ZBX_PASS=${MYSQL_PASSWORD:-"zabbix"} @@ -182,7 +182,7 @@ check_db_connect_mysql() { echo "* DB_SERVER_HOST: ${DB_SERVER_HOST}" echo "* DB_SERVER_PORT: ${DB_SERVER_PORT}" echo "* DB_SERVER_DBNAME: ${DB_SERVER_DBNAME}" - if [ "${DEBUG_MODE}" == "true" ]; then + if [ "${DEBUG_MODE,,}" == "true" ]; then if [ "${USE_DB_ROOT_USER}" == "true" ]; then echo "* DB_SERVER_ROOT_USER: ${DB_SERVER_ROOT_USER}" echo "* DB_SERVER_ROOT_PASS: ${DB_SERVER_ROOT_PASS}" @@ -321,7 +321,7 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "StartHTTPPollers" "${ZBX_STARTHTTPPOLLERS}" : ${ZBX_JAVAGATEWAY_ENABLE:="false"} - if [ "${ZBX_JAVAGATEWAY_ENABLE}" == "true" ]; then + if [ "${ZBX_JAVAGATEWAY_ENABLE,,}" == "true" ]; then update_config_var $ZBX_CONFIG "JavaGateway" "${ZBX_JAVAGATEWAY:-"zabbix-java-gateway"}" update_config_var $ZBX_CONFIG "JavaGatewayPort" "${ZBX_JAVAGATEWAYPORT}" update_config_var $ZBX_CONFIG "StartJavaPollers" "${ZBX_STARTJAVAPOLLERS:-"5"}" @@ -338,7 +338,7 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "VMwareTimeout" "${ZBX_VMWARETIMEOUT}" : ${ZBX_ENABLE_SNMP_TRAPS:="false"} - if [ "${ZBX_ENABLE_SNMP_TRAPS}" == "true" ]; then + if [ "${ZBX_ENABLE_SNMP_TRAPS,,}" == "true" ]; then update_config_var $ZBX_CONFIG "SNMPTrapperFile" "${ZABBIX_USER_HOME_DIR}/snmptraps/snmptraps.log" update_config_var $ZBX_CONFIG "StartSNMPTrapper" "1" else diff --git a/proxy-sqlite3/alpine/docker-entrypoint.sh b/proxy-sqlite3/alpine/docker-entrypoint.sh index 2173886fb..39d39e097 100755 --- a/proxy-sqlite3/alpine/docker-entrypoint.sh +++ b/proxy-sqlite3/alpine/docker-entrypoint.sh @@ -5,7 +5,7 @@ set -o pipefail set +e # Script trace mode -if [ "${DEBUG_MODE}" == "true" ]; then +if [ "${DEBUG_MODE,,}" == "true" ]; then set -o xtrace fi @@ -158,7 +158,7 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "StartHTTPPollers" "${ZBX_STARTHTTPPOLLERS}" : ${ZBX_JAVAGATEWAY_ENABLE:="false"} - if [ "${ZBX_JAVAGATEWAY_ENABLE}" == "true" ]; then + if [ "${ZBX_JAVAGATEWAY_ENABLE,,}" == "true" ]; then update_config_var $ZBX_CONFIG "JavaGateway" "${ZBX_JAVAGATEWAY:-"zabbix-java-gateway"}" update_config_var $ZBX_CONFIG "JavaGatewayPort" "${ZBX_JAVAGATEWAYPORT}" update_config_var $ZBX_CONFIG "StartJavaPollers" "${ZBX_STARTJAVAPOLLERS:-"5"}" @@ -175,7 +175,7 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "VMwareTimeout" "${ZBX_VMWARETIMEOUT}" : ${ZBX_ENABLE_SNMP_TRAPS:="false"} - if [ "${ZBX_ENABLE_SNMP_TRAPS}" == "true" ]; then + if [ "${ZBX_ENABLE_SNMP_TRAPS,,}" == "true" ]; then update_config_var $ZBX_CONFIG "SNMPTrapperFile" "${ZABBIX_USER_HOME_DIR}/snmptraps/snmptraps.log" update_config_var $ZBX_CONFIG "StartSNMPTrapper" "1" else diff --git a/proxy-sqlite3/centos/docker-entrypoint.sh b/proxy-sqlite3/centos/docker-entrypoint.sh index 2173886fb..39d39e097 100755 --- a/proxy-sqlite3/centos/docker-entrypoint.sh +++ b/proxy-sqlite3/centos/docker-entrypoint.sh @@ -5,7 +5,7 @@ set -o pipefail set +e # Script trace mode -if [ "${DEBUG_MODE}" == "true" ]; then +if [ "${DEBUG_MODE,,}" == "true" ]; then set -o xtrace fi @@ -158,7 +158,7 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "StartHTTPPollers" "${ZBX_STARTHTTPPOLLERS}" : ${ZBX_JAVAGATEWAY_ENABLE:="false"} - if [ "${ZBX_JAVAGATEWAY_ENABLE}" == "true" ]; then + if [ "${ZBX_JAVAGATEWAY_ENABLE,,}" == "true" ]; then update_config_var $ZBX_CONFIG "JavaGateway" "${ZBX_JAVAGATEWAY:-"zabbix-java-gateway"}" update_config_var $ZBX_CONFIG "JavaGatewayPort" "${ZBX_JAVAGATEWAYPORT}" update_config_var $ZBX_CONFIG "StartJavaPollers" "${ZBX_STARTJAVAPOLLERS:-"5"}" @@ -175,7 +175,7 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "VMwareTimeout" "${ZBX_VMWARETIMEOUT}" : ${ZBX_ENABLE_SNMP_TRAPS:="false"} - if [ "${ZBX_ENABLE_SNMP_TRAPS}" == "true" ]; then + if [ "${ZBX_ENABLE_SNMP_TRAPS,,}" == "true" ]; then update_config_var $ZBX_CONFIG "SNMPTrapperFile" "${ZABBIX_USER_HOME_DIR}/snmptraps/snmptraps.log" update_config_var $ZBX_CONFIG "StartSNMPTrapper" "1" else diff --git a/proxy-sqlite3/ubuntu/docker-entrypoint.sh b/proxy-sqlite3/ubuntu/docker-entrypoint.sh index f42a19189..ae3bf72f4 100755 --- a/proxy-sqlite3/ubuntu/docker-entrypoint.sh +++ b/proxy-sqlite3/ubuntu/docker-entrypoint.sh @@ -5,7 +5,7 @@ set -o pipefail set +e # Script trace mode -if [ "${DEBUG_MODE}" == "true" ]; then +if [ "${DEBUG_MODE,,}" == "true" ]; then set -o xtrace fi @@ -158,7 +158,7 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "StartHTTPPollers" "${ZBX_STARTHTTPPOLLERS}" : ${ZBX_JAVAGATEWAY_ENABLE:="false"} - if [ "${ZBX_JAVAGATEWAY_ENABLE}" == "true" ]; then + if [ "${ZBX_JAVAGATEWAY_ENABLE,,}" == "true" ]; then update_config_var $ZBX_CONFIG "JavaGateway" "${ZBX_JAVAGATEWAY:-"zabbix-java-gateway"}" update_config_var $ZBX_CONFIG "JavaGatewayPort" "${ZBX_JAVAGATEWAYPORT}" update_config_var $ZBX_CONFIG "StartJavaPollers" "${ZBX_STARTJAVAPOLLERS:-"5"}" @@ -175,7 +175,7 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "VMwareTimeout" "${ZBX_VMWARETIMEOUT}" : ${ZBX_ENABLE_SNMP_TRAPS:="false"} - if [ "${ZBX_ENABLE_SNMP_TRAPS}" == "true" ]; then + if [ "${ZBX_ENABLE_SNMP_TRAPS,,}" == "true" ]; then update_config_var $ZBX_CONFIG "SNMPTrapperFile" "${ZABBIX_USER_HOME_DIR}/snmptraps/snmptraps.log" update_config_var $ZBX_CONFIG "StartSNMPTrapper" "1" else diff --git a/server-mysql/alpine/docker-entrypoint.sh b/server-mysql/alpine/docker-entrypoint.sh index 446b37b89..6db086bca 100755 --- a/server-mysql/alpine/docker-entrypoint.sh +++ b/server-mysql/alpine/docker-entrypoint.sh @@ -5,7 +5,7 @@ set -o pipefail set +e # Script trace mode -if [ "${DEBUG_MODE}" == "true" ]; then +if [ "${DEBUG_MODE,,}" == "true" ]; then set -o xtrace fi @@ -145,17 +145,17 @@ check_variables_mysql() { file_env MYSQL_ROOT_PASSWORD - if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD}" == "true" ]; then + if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD,,}" == "true" ]; then echo "**** Impossible to use MySQL server because of unknown Zabbix user and random 'root' password" exit 1 fi - if [ ! -n "${MYSQL_USER}" ] && [ ! -n "${MYSQL_ROOT_PASSWORD}" ] && [ "${MYSQL_ALLOW_EMPTY_PASSWORD}" != "true" ]; then + if [ ! -n "${MYSQL_USER}" ] && [ ! -n "${MYSQL_ROOT_PASSWORD}" ] && [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" != "true" ]; then echo "*** Impossible to use MySQL server because 'root' password is not defined and it is not empty" exit 1 fi - if [ "${MYSQL_ALLOW_EMPTY_PASSWORD}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then + if [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then USE_DB_ROOT_USER=true DB_SERVER_ROOT_USER="root" DB_SERVER_ROOT_PASS=${MYSQL_ROOT_PASSWORD:-""} @@ -165,7 +165,7 @@ check_variables_mysql() { # If root password is not specified use provided credentials : ${DB_SERVER_ROOT_USER:=${MYSQL_USER}} - [ "${MYSQL_ALLOW_EMPTY_PASSWORD}" == "true" ] || DB_SERVER_ROOT_PASS=${DB_SERVER_ROOT_PASS:-${MYSQL_PASSWORD}} + [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || DB_SERVER_ROOT_PASS=${DB_SERVER_ROOT_PASS:-${MYSQL_PASSWORD}} DB_SERVER_ZBX_USER=${MYSQL_USER:-"zabbix"} DB_SERVER_ZBX_PASS=${MYSQL_PASSWORD:-"zabbix"} @@ -177,7 +177,7 @@ check_db_connect_mysql() { echo "* DB_SERVER_HOST: ${DB_SERVER_HOST}" echo "* DB_SERVER_PORT: ${DB_SERVER_PORT}" echo "* DB_SERVER_DBNAME: ${DB_SERVER_DBNAME}" - if [ "${DEBUG_MODE}" == "true" ]; then + if [ "${DEBUG_MODE,,}" == "true" ]; then if [ "${USE_DB_ROOT_USER}" == "true" ]; then echo "* DB_SERVER_ROOT_USER: ${DB_SERVER_ROOT_USER}" echo "* DB_SERVER_ROOT_PASS: ${DB_SERVER_ROOT_PASS}" @@ -302,7 +302,7 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "StartEscalators" "${ZBX_STARTESCALATORS}" : ${ZBX_JAVAGATEWAY_ENABLE:="false"} - if [ "${ZBX_JAVAGATEWAY_ENABLE}" == "true" ]; then + if [ "${ZBX_JAVAGATEWAY_ENABLE,,}" == "true" ]; then update_config_var $ZBX_CONFIG "JavaGateway" "${ZBX_JAVAGATEWAY:-"zabbix-java-gateway"}" update_config_var $ZBX_CONFIG "JavaGatewayPort" "${ZBX_JAVAGATEWAYPORT}" update_config_var $ZBX_CONFIG "StartJavaPollers" "${ZBX_STARTJAVAPOLLERS:-"5"}" @@ -319,7 +319,7 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "VMwareTimeout" "${ZBX_VMWARETIMEOUT}" : ${ZBX_ENABLE_SNMP_TRAPS:="false"} - if [ "${ZBX_ENABLE_SNMP_TRAPS}" == "true" ]; then + if [ "${ZBX_ENABLE_SNMP_TRAPS,,}" == "true" ]; then update_config_var $ZBX_CONFIG "SNMPTrapperFile" "${ZABBIX_USER_HOME_DIR}/snmptraps/snmptraps.log" update_config_var $ZBX_CONFIG "StartSNMPTrapper" "1" else diff --git a/server-mysql/centos/docker-entrypoint.sh b/server-mysql/centos/docker-entrypoint.sh index 446b37b89..6db086bca 100755 --- a/server-mysql/centos/docker-entrypoint.sh +++ b/server-mysql/centos/docker-entrypoint.sh @@ -5,7 +5,7 @@ set -o pipefail set +e # Script trace mode -if [ "${DEBUG_MODE}" == "true" ]; then +if [ "${DEBUG_MODE,,}" == "true" ]; then set -o xtrace fi @@ -145,17 +145,17 @@ check_variables_mysql() { file_env MYSQL_ROOT_PASSWORD - if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD}" == "true" ]; then + if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD,,}" == "true" ]; then echo "**** Impossible to use MySQL server because of unknown Zabbix user and random 'root' password" exit 1 fi - if [ ! -n "${MYSQL_USER}" ] && [ ! -n "${MYSQL_ROOT_PASSWORD}" ] && [ "${MYSQL_ALLOW_EMPTY_PASSWORD}" != "true" ]; then + if [ ! -n "${MYSQL_USER}" ] && [ ! -n "${MYSQL_ROOT_PASSWORD}" ] && [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" != "true" ]; then echo "*** Impossible to use MySQL server because 'root' password is not defined and it is not empty" exit 1 fi - if [ "${MYSQL_ALLOW_EMPTY_PASSWORD}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then + if [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then USE_DB_ROOT_USER=true DB_SERVER_ROOT_USER="root" DB_SERVER_ROOT_PASS=${MYSQL_ROOT_PASSWORD:-""} @@ -165,7 +165,7 @@ check_variables_mysql() { # If root password is not specified use provided credentials : ${DB_SERVER_ROOT_USER:=${MYSQL_USER}} - [ "${MYSQL_ALLOW_EMPTY_PASSWORD}" == "true" ] || DB_SERVER_ROOT_PASS=${DB_SERVER_ROOT_PASS:-${MYSQL_PASSWORD}} + [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || DB_SERVER_ROOT_PASS=${DB_SERVER_ROOT_PASS:-${MYSQL_PASSWORD}} DB_SERVER_ZBX_USER=${MYSQL_USER:-"zabbix"} DB_SERVER_ZBX_PASS=${MYSQL_PASSWORD:-"zabbix"} @@ -177,7 +177,7 @@ check_db_connect_mysql() { echo "* DB_SERVER_HOST: ${DB_SERVER_HOST}" echo "* DB_SERVER_PORT: ${DB_SERVER_PORT}" echo "* DB_SERVER_DBNAME: ${DB_SERVER_DBNAME}" - if [ "${DEBUG_MODE}" == "true" ]; then + if [ "${DEBUG_MODE,,}" == "true" ]; then if [ "${USE_DB_ROOT_USER}" == "true" ]; then echo "* DB_SERVER_ROOT_USER: ${DB_SERVER_ROOT_USER}" echo "* DB_SERVER_ROOT_PASS: ${DB_SERVER_ROOT_PASS}" @@ -302,7 +302,7 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "StartEscalators" "${ZBX_STARTESCALATORS}" : ${ZBX_JAVAGATEWAY_ENABLE:="false"} - if [ "${ZBX_JAVAGATEWAY_ENABLE}" == "true" ]; then + if [ "${ZBX_JAVAGATEWAY_ENABLE,,}" == "true" ]; then update_config_var $ZBX_CONFIG "JavaGateway" "${ZBX_JAVAGATEWAY:-"zabbix-java-gateway"}" update_config_var $ZBX_CONFIG "JavaGatewayPort" "${ZBX_JAVAGATEWAYPORT}" update_config_var $ZBX_CONFIG "StartJavaPollers" "${ZBX_STARTJAVAPOLLERS:-"5"}" @@ -319,7 +319,7 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "VMwareTimeout" "${ZBX_VMWARETIMEOUT}" : ${ZBX_ENABLE_SNMP_TRAPS:="false"} - if [ "${ZBX_ENABLE_SNMP_TRAPS}" == "true" ]; then + if [ "${ZBX_ENABLE_SNMP_TRAPS,,}" == "true" ]; then update_config_var $ZBX_CONFIG "SNMPTrapperFile" "${ZABBIX_USER_HOME_DIR}/snmptraps/snmptraps.log" update_config_var $ZBX_CONFIG "StartSNMPTrapper" "1" else diff --git a/server-mysql/ubuntu/docker-entrypoint.sh b/server-mysql/ubuntu/docker-entrypoint.sh index 1595dd37b..34d455680 100755 --- a/server-mysql/ubuntu/docker-entrypoint.sh +++ b/server-mysql/ubuntu/docker-entrypoint.sh @@ -5,7 +5,7 @@ set -o pipefail set +e # Script trace mode -if [ "${DEBUG_MODE}" == "true" ]; then +if [ "${DEBUG_MODE,,}" == "true" ]; then set -o xtrace fi @@ -145,17 +145,17 @@ check_variables_mysql() { file_env MYSQL_ROOT_PASSWORD - if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD}" == "true" ]; then + if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD,,}" == "true" ]; then echo "**** Impossible to use MySQL server because of unknown Zabbix user and random 'root' password" exit 1 fi - if [ ! -n "${MYSQL_USER}" ] && [ ! -n "${MYSQL_ROOT_PASSWORD}" ] && [ "${MYSQL_ALLOW_EMPTY_PASSWORD}" != "true" ]; then + if [ ! -n "${MYSQL_USER}" ] && [ ! -n "${MYSQL_ROOT_PASSWORD}" ] && [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" != "true" ]; then echo "*** Impossible to use MySQL server because 'root' password is not defined and it is not empty" exit 1 fi - if [ "${MYSQL_ALLOW_EMPTY_PASSWORD}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then + if [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then USE_DB_ROOT_USER=true DB_SERVER_ROOT_USER="root" DB_SERVER_ROOT_PASS=${MYSQL_ROOT_PASSWORD:-""} @@ -165,7 +165,7 @@ check_variables_mysql() { # If root password is not specified use provided credentials : ${DB_SERVER_ROOT_USER:=${MYSQL_USER}} - [ "${MYSQL_ALLOW_EMPTY_PASSWORD}" == "true" ] || DB_SERVER_ROOT_PASS=${DB_SERVER_ROOT_PASS:-${MYSQL_PASSWORD}} + [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || DB_SERVER_ROOT_PASS=${DB_SERVER_ROOT_PASS:-${MYSQL_PASSWORD}} DB_SERVER_ZBX_USER=${MYSQL_USER:-"zabbix"} DB_SERVER_ZBX_PASS=${MYSQL_PASSWORD:-"zabbix"} @@ -177,7 +177,7 @@ check_db_connect_mysql() { echo "* DB_SERVER_HOST: ${DB_SERVER_HOST}" echo "* DB_SERVER_PORT: ${DB_SERVER_PORT}" echo "* DB_SERVER_DBNAME: ${DB_SERVER_DBNAME}" - if [ "${DEBUG_MODE}" == "true" ]; then + if [ "${DEBUG_MODE,,}" == "true" ]; then if [ "${USE_DB_ROOT_USER}" == "true" ]; then echo "* DB_SERVER_ROOT_USER: ${DB_SERVER_ROOT_USER}" echo "* DB_SERVER_ROOT_PASS: ${DB_SERVER_ROOT_PASS}" @@ -302,7 +302,7 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "StartEscalators" "${ZBX_STARTESCALATORS}" : ${ZBX_JAVAGATEWAY_ENABLE:="false"} - if [ "${ZBX_JAVAGATEWAY_ENABLE}" == "true" ]; then + if [ "${ZBX_JAVAGATEWAY_ENABLE,,}" == "true" ]; then update_config_var $ZBX_CONFIG "JavaGateway" "${ZBX_JAVAGATEWAY:-"zabbix-java-gateway"}" update_config_var $ZBX_CONFIG "JavaGatewayPort" "${ZBX_JAVAGATEWAYPORT}" update_config_var $ZBX_CONFIG "StartJavaPollers" "${ZBX_STARTJAVAPOLLERS:-"5"}" @@ -319,7 +319,7 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "VMwareTimeout" "${ZBX_VMWARETIMEOUT}" : ${ZBX_ENABLE_SNMP_TRAPS:="false"} - if [ "${ZBX_ENABLE_SNMP_TRAPS}" == "true" ]; then + if [ "${ZBX_ENABLE_SNMP_TRAPS,,}" == "true" ]; then update_config_var $ZBX_CONFIG "SNMPTrapperFile" "${ZABBIX_USER_HOME_DIR}/snmptraps/snmptraps.log" update_config_var $ZBX_CONFIG "StartSNMPTrapper" "1" else diff --git a/server-pgsql/alpine/docker-entrypoint.sh b/server-pgsql/alpine/docker-entrypoint.sh index eb075cd05..b15aa17e7 100755 --- a/server-pgsql/alpine/docker-entrypoint.sh +++ b/server-pgsql/alpine/docker-entrypoint.sh @@ -5,7 +5,7 @@ set -o pipefail set +e # Script trace mode -if [ "${DEBUG_MODE}" == "true" ]; then +if [ "${DEBUG_MODE,,}" == "true" ]; then set -o xtrace fi @@ -159,7 +159,7 @@ check_db_connect_postgresql() { echo "* DB_SERVER_PORT: ${DB_SERVER_PORT}" echo "* DB_SERVER_DBNAME: ${DB_SERVER_DBNAME}" echo "* DB_SERVER_SCHEMA: ${DB_SERVER_SCHEMA}" - if [ "${DEBUG_MODE}" == "true" ]; then + if [ "${DEBUG_MODE,,}" == "true" ]; then echo "* DB_SERVER_ZBX_USER: ${DB_SERVER_ZBX_USER}" echo "* DB_SERVER_ZBX_PASS: ${DB_SERVER_ZBX_PASS}" fi @@ -310,7 +310,7 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "StartEscalators" "${ZBX_STARTESCALATORS}" : ${ZBX_JAVAGATEWAY_ENABLE:="false"} - if [ "${ZBX_JAVAGATEWAY_ENABLE}" == "true" ]; then + if [ "${ZBX_JAVAGATEWAY_ENABLE,,}" == "true" ]; then update_config_var $ZBX_CONFIG "JavaGateway" "${ZBX_JAVAGATEWAY:-"zabbix-java-gateway"}" update_config_var $ZBX_CONFIG "JavaGatewayPort" "${ZBX_JAVAGATEWAYPORT}" update_config_var $ZBX_CONFIG "StartJavaPollers" "${ZBX_STARTJAVAPOLLERS:-"5"}" @@ -327,7 +327,7 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "VMwareTimeout" "${ZBX_VMWARETIMEOUT}" : ${ZBX_ENABLE_SNMP_TRAPS:="false"} - if [ "${ZBX_ENABLE_SNMP_TRAPS}" == "true" ]; then + if [ "${ZBX_ENABLE_SNMP_TRAPS,,}" == "true" ]; then update_config_var $ZBX_CONFIG "SNMPTrapperFile" "${ZABBIX_USER_HOME_DIR}/snmptraps/snmptraps.log" update_config_var $ZBX_CONFIG "StartSNMPTrapper" "1" else diff --git a/server-pgsql/centos/docker-entrypoint.sh b/server-pgsql/centos/docker-entrypoint.sh index eb075cd05..b15aa17e7 100755 --- a/server-pgsql/centos/docker-entrypoint.sh +++ b/server-pgsql/centos/docker-entrypoint.sh @@ -5,7 +5,7 @@ set -o pipefail set +e # Script trace mode -if [ "${DEBUG_MODE}" == "true" ]; then +if [ "${DEBUG_MODE,,}" == "true" ]; then set -o xtrace fi @@ -159,7 +159,7 @@ check_db_connect_postgresql() { echo "* DB_SERVER_PORT: ${DB_SERVER_PORT}" echo "* DB_SERVER_DBNAME: ${DB_SERVER_DBNAME}" echo "* DB_SERVER_SCHEMA: ${DB_SERVER_SCHEMA}" - if [ "${DEBUG_MODE}" == "true" ]; then + if [ "${DEBUG_MODE,,}" == "true" ]; then echo "* DB_SERVER_ZBX_USER: ${DB_SERVER_ZBX_USER}" echo "* DB_SERVER_ZBX_PASS: ${DB_SERVER_ZBX_PASS}" fi @@ -310,7 +310,7 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "StartEscalators" "${ZBX_STARTESCALATORS}" : ${ZBX_JAVAGATEWAY_ENABLE:="false"} - if [ "${ZBX_JAVAGATEWAY_ENABLE}" == "true" ]; then + if [ "${ZBX_JAVAGATEWAY_ENABLE,,}" == "true" ]; then update_config_var $ZBX_CONFIG "JavaGateway" "${ZBX_JAVAGATEWAY:-"zabbix-java-gateway"}" update_config_var $ZBX_CONFIG "JavaGatewayPort" "${ZBX_JAVAGATEWAYPORT}" update_config_var $ZBX_CONFIG "StartJavaPollers" "${ZBX_STARTJAVAPOLLERS:-"5"}" @@ -327,7 +327,7 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "VMwareTimeout" "${ZBX_VMWARETIMEOUT}" : ${ZBX_ENABLE_SNMP_TRAPS:="false"} - if [ "${ZBX_ENABLE_SNMP_TRAPS}" == "true" ]; then + if [ "${ZBX_ENABLE_SNMP_TRAPS,,}" == "true" ]; then update_config_var $ZBX_CONFIG "SNMPTrapperFile" "${ZABBIX_USER_HOME_DIR}/snmptraps/snmptraps.log" update_config_var $ZBX_CONFIG "StartSNMPTrapper" "1" else diff --git a/server-pgsql/ubuntu/docker-entrypoint.sh b/server-pgsql/ubuntu/docker-entrypoint.sh index 4305bd2c9..37214bebf 100755 --- a/server-pgsql/ubuntu/docker-entrypoint.sh +++ b/server-pgsql/ubuntu/docker-entrypoint.sh @@ -5,7 +5,7 @@ set -o pipefail set +e # Script trace mode -if [ "${DEBUG_MODE}" == "true" ]; then +if [ "${DEBUG_MODE,,}" == "true" ]; then set -o xtrace fi @@ -159,7 +159,7 @@ check_db_connect_postgresql() { echo "* DB_SERVER_PORT: ${DB_SERVER_PORT}" echo "* DB_SERVER_DBNAME: ${DB_SERVER_DBNAME}" echo "* DB_SERVER_SCHEMA: ${DB_SERVER_SCHEMA}" - if [ "${DEBUG_MODE}" == "true" ]; then + if [ "${DEBUG_MODE,,}" == "true" ]; then echo "* DB_SERVER_ZBX_USER: ${DB_SERVER_ZBX_USER}" echo "* DB_SERVER_ZBX_PASS: ${DB_SERVER_ZBX_PASS}" fi @@ -310,7 +310,7 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "StartEscalators" "${ZBX_STARTESCALATORS}" : ${ZBX_JAVAGATEWAY_ENABLE:="false"} - if [ "${ZBX_JAVAGATEWAY_ENABLE}" == "true" ]; then + if [ "${ZBX_JAVAGATEWAY_ENABLE,,}" == "true" ]; then update_config_var $ZBX_CONFIG "JavaGateway" "${ZBX_JAVAGATEWAY:-"zabbix-java-gateway"}" update_config_var $ZBX_CONFIG "JavaGatewayPort" "${ZBX_JAVAGATEWAYPORT}" update_config_var $ZBX_CONFIG "StartJavaPollers" "${ZBX_STARTJAVAPOLLERS:-"5"}" @@ -327,7 +327,7 @@ update_zbx_config() { update_config_var $ZBX_CONFIG "VMwareTimeout" "${ZBX_VMWARETIMEOUT}" : ${ZBX_ENABLE_SNMP_TRAPS:="false"} - if [ "${ZBX_ENABLE_SNMP_TRAPS}" == "true" ]; then + if [ "${ZBX_ENABLE_SNMP_TRAPS,,}" == "true" ]; then update_config_var $ZBX_CONFIG "SNMPTrapperFile" "${ZABBIX_USER_HOME_DIR}/snmptraps/snmptraps.log" update_config_var $ZBX_CONFIG "StartSNMPTrapper" "1" else diff --git a/web-apache-mysql/alpine/docker-entrypoint.sh b/web-apache-mysql/alpine/docker-entrypoint.sh index 72aba5578..9a756f51c 100755 --- a/web-apache-mysql/alpine/docker-entrypoint.sh +++ b/web-apache-mysql/alpine/docker-entrypoint.sh @@ -5,7 +5,7 @@ set -o pipefail set +e # Script trace mode -if [ "${DEBUG_MODE}" == "true" ]; then +if [ "${DEBUG_MODE,,}" == "true" ]; then set -o xtrace fi @@ -66,17 +66,17 @@ check_variables() { file_env MYSQL_USER file_env MYSQL_PASSWORD - if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD}" == "true" ]; then + if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD,,}" == "true" ]; then echo "**** Impossible to use MySQL server because of unknown Zabbix user and random 'root' password" exit 1 fi - if [ ! -n "${MYSQL_USER}" ] && [ ! -n "${MYSQL_ROOT_PASSWORD}" ] && [ "${MYSQL_ALLOW_EMPTY_PASSWORD}" != "true" ]; then + if [ ! -n "${MYSQL_USER}" ] && [ ! -n "${MYSQL_ROOT_PASSWORD}" ] && [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" != "true" ]; then echo "*** Impossible to use MySQL server because 'root' password is not defined and it is not empty" exit 1 fi - if [ "${MYSQL_ALLOW_EMPTY_PASSWORD}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then + if [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then USE_DB_ROOT_USER=true DB_SERVER_ROOT_USER="root" DB_SERVER_ROOT_PASS=${MYSQL_ROOT_PASSWORD:-""} @@ -86,7 +86,7 @@ check_variables() { # If root password is not specified use provided credentials : ${DB_SERVER_ROOT_USER:=${MYSQL_USER}} - [ "${MYSQL_ALLOW_EMPTY_PASSWORD}" == "true" ] || DB_SERVER_ROOT_PASS=${DB_SERVER_ROOT_PASS:-${MYSQL_PASSWORD}} + [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || DB_SERVER_ROOT_PASS=${DB_SERVER_ROOT_PASS:-${MYSQL_PASSWORD}} DB_SERVER_ZBX_USER=${MYSQL_USER:-"zabbix"} DB_SERVER_ZBX_PASS=${MYSQL_PASSWORD:-"zabbix"} @@ -98,7 +98,7 @@ check_db_connect() { echo "* DB_SERVER_HOST: ${DB_SERVER_HOST}" echo "* DB_SERVER_PORT: ${DB_SERVER_PORT}" echo "* DB_SERVER_DBNAME: ${DB_SERVER_DBNAME}" - if [ "${DEBUG_MODE}" == "true" ]; then + if [ "${DEBUG_MODE,,}" == "true" ]; then if [ "${USE_DB_ROOT_USER}" == "true" ]; then echo "* DB_SERVER_ROOT_USER: ${DB_SERVER_ROOT_USER}" echo "* DB_SERVER_ROOT_PASS: ${DB_SERVER_ROOT_PASS}" @@ -168,7 +168,9 @@ prepare_zbx_web_config() { export ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"} export ZBX_SERVER_NAME=${ZBX_SERVER_NAME} - if [ "${ENABLE_WEB_ACCESS_LOG:-"true"}" == "false" ]; then + ENABLE_WEB_ACCESS_LOG=${ENABLE_WEB_ACCESS_LOG:-"true"} + + if [ "${ENABLE_WEB_ACCESS_LOG,,}" == "false" ]; then sed -ri \ -e 's!^(\s*CustomLog)\s+\S+!\1 /dev/null!g' \ "/etc/apache2/httpd.conf" diff --git a/web-apache-mysql/centos/docker-entrypoint.sh b/web-apache-mysql/centos/docker-entrypoint.sh index 94612251f..5ff556d2d 100755 --- a/web-apache-mysql/centos/docker-entrypoint.sh +++ b/web-apache-mysql/centos/docker-entrypoint.sh @@ -5,7 +5,7 @@ set -o pipefail set +e # Script trace mode -if [ "${DEBUG_MODE}" == "true" ]; then +if [ "${DEBUG_MODE,,}" == "true" ]; then set -o xtrace fi @@ -66,17 +66,17 @@ check_variables() { file_env MYSQL_USER file_env MYSQL_PASSWORD - if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD}" == "true" ]; then + if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD,,}" == "true" ]; then echo "**** Impossible to use MySQL server because of unknown Zabbix user and random 'root' password" exit 1 fi - if [ ! -n "${MYSQL_USER}" ] && [ ! -n "${MYSQL_ROOT_PASSWORD}" ] && [ "${MYSQL_ALLOW_EMPTY_PASSWORD}" != "true" ]; then + if [ ! -n "${MYSQL_USER}" ] && [ ! -n "${MYSQL_ROOT_PASSWORD}" ] && [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" != "true" ]; then echo "*** Impossible to use MySQL server because 'root' password is not defined and it is not empty" exit 1 fi - if [ "${MYSQL_ALLOW_EMPTY_PASSWORD}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then + if [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then USE_DB_ROOT_USER=true DB_SERVER_ROOT_USER="root" DB_SERVER_ROOT_PASS=${MYSQL_ROOT_PASSWORD:-""} @@ -86,7 +86,7 @@ check_variables() { # If root password is not specified use provided credentials : ${DB_SERVER_ROOT_USER:=${MYSQL_USER}} - [ "${MYSQL_ALLOW_EMPTY_PASSWORD}" == "true" ] || DB_SERVER_ROOT_PASS=${DB_SERVER_ROOT_PASS:-${MYSQL_PASSWORD}} + [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || DB_SERVER_ROOT_PASS=${DB_SERVER_ROOT_PASS:-${MYSQL_PASSWORD}} DB_SERVER_ZBX_USER=${MYSQL_USER:-"zabbix"} DB_SERVER_ZBX_PASS=${MYSQL_PASSWORD:-"zabbix"} @@ -98,7 +98,7 @@ check_db_connect() { echo "* DB_SERVER_HOST: ${DB_SERVER_HOST}" echo "* DB_SERVER_PORT: ${DB_SERVER_PORT}" echo "* DB_SERVER_DBNAME: ${DB_SERVER_DBNAME}" - if [ "${DEBUG_MODE}" == "true" ]; then + if [ "${DEBUG_MODE,,}" == "true" ]; then if [ "${USE_DB_ROOT_USER}" == "true" ]; then echo "* DB_SERVER_ROOT_USER: ${DB_SERVER_ROOT_USER}" echo "* DB_SERVER_ROOT_PASS: ${DB_SERVER_ROOT_PASS}" @@ -168,7 +168,9 @@ prepare_zbx_web_config() { export ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"} export ZBX_SERVER_NAME=${ZBX_SERVER_NAME} - if [ "${ENABLE_WEB_ACCESS_LOG:-"true"}" == "false" ]; then + ENABLE_WEB_ACCESS_LOG=${ENABLE_WEB_ACCESS_LOG:-"true"} + + if [ "${ENABLE_WEB_ACCESS_LOG,,}" == "false" ]; then sed -ri \ -e 's!^(\s*CustomLog)\s+\S+!\1 /dev/null!g' \ "/etc/httpd/conf/httpd.conf" diff --git a/web-apache-mysql/ubuntu/docker-entrypoint.sh b/web-apache-mysql/ubuntu/docker-entrypoint.sh index cf7b4d8f8..b42a664ca 100755 --- a/web-apache-mysql/ubuntu/docker-entrypoint.sh +++ b/web-apache-mysql/ubuntu/docker-entrypoint.sh @@ -5,7 +5,7 @@ set -o pipefail set +e # Script trace mode -if [ "${DEBUG_MODE}" == "true" ]; then +if [ "${DEBUG_MODE,,}" == "true" ]; then set -o xtrace fi @@ -66,17 +66,17 @@ check_variables() { file_env MYSQL_USER file_env MYSQL_PASSWORD - if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD}" == "true" ]; then + if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD,,}" == "true" ]; then echo "**** Impossible to use MySQL server because of unknown Zabbix user and random 'root' password" exit 1 fi - if [ ! -n "${MYSQL_USER}" ] && [ ! -n "${MYSQL_ROOT_PASSWORD}" ] && [ "${MYSQL_ALLOW_EMPTY_PASSWORD}" != "true" ]; then + if [ ! -n "${MYSQL_USER}" ] && [ ! -n "${MYSQL_ROOT_PASSWORD}" ] && [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" != "true" ]; then echo "*** Impossible to use MySQL server because 'root' password is not defined and it is not empty" exit 1 fi - if [ "${MYSQL_ALLOW_EMPTY_PASSWORD}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then + if [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then USE_DB_ROOT_USER=true DB_SERVER_ROOT_USER="root" DB_SERVER_ROOT_PASS=${MYSQL_ROOT_PASSWORD:-""} @@ -86,7 +86,7 @@ check_variables() { # If root password is not specified use provided credentials : ${DB_SERVER_ROOT_USER:=${MYSQL_USER}} - [ "${MYSQL_ALLOW_EMPTY_PASSWORD}" == "true" ] || DB_SERVER_ROOT_PASS=${DB_SERVER_ROOT_PASS:-${MYSQL_PASSWORD}} + [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || DB_SERVER_ROOT_PASS=${DB_SERVER_ROOT_PASS:-${MYSQL_PASSWORD}} DB_SERVER_ZBX_USER=${MYSQL_USER:-"zabbix"} DB_SERVER_ZBX_PASS=${MYSQL_PASSWORD:-"zabbix"} @@ -98,7 +98,7 @@ check_db_connect() { echo "* DB_SERVER_HOST: ${DB_SERVER_HOST}" echo "* DB_SERVER_PORT: ${DB_SERVER_PORT}" echo "* DB_SERVER_DBNAME: ${DB_SERVER_DBNAME}" - if [ "${DEBUG_MODE}" == "true" ]; then + if [ "${DEBUG_MODE,,}" == "true" ]; then if [ "${USE_DB_ROOT_USER}" == "true" ]; then echo "* DB_SERVER_ROOT_USER: ${DB_SERVER_ROOT_USER}" echo "* DB_SERVER_ROOT_PASS: ${DB_SERVER_ROOT_PASS}" @@ -168,7 +168,9 @@ prepare_zbx_web_config() { export ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"} export ZBX_SERVER_NAME=${ZBX_SERVER_NAME} - if [ "${ENABLE_WEB_ACCESS_LOG:-"true"}" == "false" ]; then + ENABLE_WEB_ACCESS_LOG=${ENABLE_WEB_ACCESS_LOG:-"true"} + + if [ "${ENABLE_WEB_ACCESS_LOG,,}" == "false" ]; then sed -ri \ -e 's!^(\s*CustomLog)\s+\S+!\1 /dev/null!g' \ "/etc/apache2/apache2.conf" diff --git a/web-apache-pgsql/alpine/docker-entrypoint.sh b/web-apache-pgsql/alpine/docker-entrypoint.sh index 16297630c..b0d793525 100755 --- a/web-apache-pgsql/alpine/docker-entrypoint.sh +++ b/web-apache-pgsql/alpine/docker-entrypoint.sh @@ -5,7 +5,7 @@ set -o pipefail set +e # Script trace mode -if [ "${DEBUG_MODE}" == "true" ]; then +if [ "${DEBUG_MODE,,}" == "true" ]; then set -o xtrace fi @@ -83,7 +83,7 @@ check_db_connect() { echo "* DB_SERVER_PORT: ${DB_SERVER_PORT}" echo "* DB_SERVER_DBNAME: ${DB_SERVER_DBNAME}" echo "* DB_SERVER_SCHEMA: ${DB_SERVER_SCHEMA}" - if [ "${DEBUG_MODE}" == "true" ]; then + if [ "${DEBUG_MODE,,}" == "true" ]; then if [ "${USE_DB_ROOT_USER}" == "true" ]; then echo "* DB_SERVER_ROOT_USER: ${DB_SERVER_ROOT_USER}" echo "* DB_SERVER_ROOT_PASS: ${DB_SERVER_ROOT_PASS}" @@ -165,7 +165,9 @@ prepare_zbx_web_config() { export ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"} export ZBX_SERVER_NAME=${ZBX_SERVER_NAME} - if [ "${ENABLE_WEB_ACCESS_LOG:-"true"}" == "false" ]; then + ENABLE_WEB_ACCESS_LOG=${ENABLE_WEB_ACCESS_LOG:-"true"} + + if [ "${ENABLE_WEB_ACCESS_LOG,,}" == "false" ]; then sed -ri \ -e 's!^(\s*CustomLog)\s+\S+!\1 /dev/null!g' \ "/etc/apache2/httpd.conf" diff --git a/web-apache-pgsql/centos/docker-entrypoint.sh b/web-apache-pgsql/centos/docker-entrypoint.sh index d924f2ff2..e8eac21b6 100755 --- a/web-apache-pgsql/centos/docker-entrypoint.sh +++ b/web-apache-pgsql/centos/docker-entrypoint.sh @@ -5,7 +5,7 @@ set -o pipefail set +e # Script trace mode -if [ "${DEBUG_MODE}" == "true" ]; then +if [ "${DEBUG_MODE,,}" == "true" ]; then set -o xtrace fi @@ -83,7 +83,7 @@ check_db_connect() { echo "* DB_SERVER_PORT: ${DB_SERVER_PORT}" echo "* DB_SERVER_DBNAME: ${DB_SERVER_DBNAME}" echo "* DB_SERVER_SCHEMA: ${DB_SERVER_SCHEMA}" - if [ "${DEBUG_MODE}" == "true" ]; then + if [ "${DEBUG_MODE,,}" == "true" ]; then if [ "${USE_DB_ROOT_USER}" == "true" ]; then echo "* DB_SERVER_ROOT_USER: ${DB_SERVER_ROOT_USER}" echo "* DB_SERVER_ROOT_PASS: ${DB_SERVER_ROOT_PASS}" @@ -165,7 +165,9 @@ prepare_zbx_web_config() { export ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"} export ZBX_SERVER_NAME=${ZBX_SERVER_NAME} - if [ "${ENABLE_WEB_ACCESS_LOG:-"true"}" == "false" ]; then + ENABLE_WEB_ACCESS_LOG=${ENABLE_WEB_ACCESS_LOG:-"true"} + + if [ "${ENABLE_WEB_ACCESS_LOG,,}" == "false" ]; then sed -ri \ -e 's!^(\s*CustomLog)\s+\S+!\1 /dev/null!g' \ "/etc/httpd/conf/httpd.conf" diff --git a/web-apache-pgsql/ubuntu/docker-entrypoint.sh b/web-apache-pgsql/ubuntu/docker-entrypoint.sh index 10f005e3a..d738a5f3c 100755 --- a/web-apache-pgsql/ubuntu/docker-entrypoint.sh +++ b/web-apache-pgsql/ubuntu/docker-entrypoint.sh @@ -5,7 +5,7 @@ set -o pipefail set +e # Script trace mode -if [ "${DEBUG_MODE}" == "true" ]; then +if [ "${DEBUG_MODE,,}" == "true" ]; then set -o xtrace fi @@ -83,7 +83,7 @@ check_db_connect() { echo "* DB_SERVER_PORT: ${DB_SERVER_PORT}" echo "* DB_SERVER_DBNAME: ${DB_SERVER_DBNAME}" echo "* DB_SERVER_SCHEMA: ${DB_SERVER_SCHEMA}" - if [ "${DEBUG_MODE}" == "true" ]; then + if [ "${DEBUG_MODE,,}" == "true" ]; then if [ "${USE_DB_ROOT_USER}" == "true" ]; then echo "* DB_SERVER_ROOT_USER: ${DB_SERVER_ROOT_USER}" echo "* DB_SERVER_ROOT_PASS: ${DB_SERVER_ROOT_PASS}" @@ -165,7 +165,9 @@ prepare_zbx_web_config() { export ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"} export ZBX_SERVER_NAME=${ZBX_SERVER_NAME} - if [ "${ENABLE_WEB_ACCESS_LOG:-"true"}" == "false" ]; then + ENABLE_WEB_ACCESS_LOG=${ENABLE_WEB_ACCESS_LOG:-"true"} + + if [ "${ENABLE_WEB_ACCESS_LOG,,}" == "false" ]; then sed -ri \ -e 's!^(\s*CustomLog)\s+\S+!\1 /dev/null!g' \ "/etc/apache2/apache2.conf" diff --git a/web-nginx-mysql/alpine/docker-entrypoint.sh b/web-nginx-mysql/alpine/docker-entrypoint.sh index 0c2b8a7e4..d7de2624d 100755 --- a/web-nginx-mysql/alpine/docker-entrypoint.sh +++ b/web-nginx-mysql/alpine/docker-entrypoint.sh @@ -5,7 +5,7 @@ set -o pipefail set +e # Script trace mode -if [ "${DEBUG_MODE}" == "true" ]; then +if [ "${DEBUG_MODE,,}" == "true" ]; then set -o xtrace fi @@ -66,17 +66,17 @@ check_variables() { file_env MYSQL_USER file_env MYSQL_PASSWORD - if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD}" == "true" ]; then + if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD,,}" == "true" ]; then echo "**** Impossible to use MySQL server because of unknown Zabbix user and random 'root' password" exit 1 fi - if [ ! -n "${MYSQL_USER}" ] && [ ! -n "${MYSQL_ROOT_PASSWORD}" ] && [ "${MYSQL_ALLOW_EMPTY_PASSWORD}" != "true" ]; then + if [ ! -n "${MYSQL_USER}" ] && [ ! -n "${MYSQL_ROOT_PASSWORD}" ] && [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" != "true" ]; then echo "*** Impossible to use MySQL server because 'root' password is not defined and it is not empty" exit 1 fi - if [ "${MYSQL_ALLOW_EMPTY_PASSWORD}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then + if [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then USE_DB_ROOT_USER=true DB_SERVER_ROOT_USER="root" DB_SERVER_ROOT_PASS=${MYSQL_ROOT_PASSWORD:-""} @@ -85,8 +85,8 @@ check_variables() { [ -n "${MYSQL_USER}" ] && CREATE_ZBX_DB_USER=true # If root password is not specified use provided credentials - : ${DB_SERVER_ROOT_USER:=${MYSQL_USER}}.... - [ "${MYSQL_ALLOW_EMPTY_PASSWORD}" == "true" ] || DB_SERVER_ROOT_PASS=${DB_SERVER_ROOT_PASS:-${MYSQL_PASSWORD}} + : ${DB_SERVER_ROOT_USER:=${MYSQL_USER}} + [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || DB_SERVER_ROOT_PASS=${DB_SERVER_ROOT_PASS:-${MYSQL_PASSWORD}} DB_SERVER_ZBX_USER=${MYSQL_USER:-"zabbix"} DB_SERVER_ZBX_PASS=${MYSQL_PASSWORD:-"zabbix"} @@ -98,7 +98,7 @@ check_db_connect() { echo "* DB_SERVER_HOST: ${DB_SERVER_HOST}" echo "* DB_SERVER_PORT: ${DB_SERVER_PORT}" echo "* DB_SERVER_DBNAME: ${DB_SERVER_DBNAME}" - if [ "${DEBUG_MODE}" == "true" ]; then + if [ "${DEBUG_MODE,,}" == "true" ]; then if [ "${USE_DB_ROOT_USER}" == "true" ]; then echo "* DB_SERVER_ROOT_USER: ${DB_SERVER_ROOT_USER}" echo "* DB_SERVER_ROOT_PASS: ${DB_SERVER_ROOT_PASS}" @@ -189,7 +189,9 @@ prepare_zbx_web_config() { "$ZABBIX_ETC_DIR/nginx_ssl.conf" fi - if [ "${ENABLE_WEB_ACCESS_LOG:-"true"}" == "false" ]; then + ENABLE_WEB_ACCESS_LOG=${ENABLE_WEB_ACCESS_LOG:-"true"} + + if [ "${ENABLE_WEB_ACCESS_LOG,,}" == "false" ]; then sed -ri \ -e 's!^(\s*access_log).+\;!\1 off\;!g' \ "/etc/nginx/nginx.conf" diff --git a/web-nginx-mysql/centos/docker-entrypoint.sh b/web-nginx-mysql/centos/docker-entrypoint.sh index 962f4f388..bb70db748 100755 --- a/web-nginx-mysql/centos/docker-entrypoint.sh +++ b/web-nginx-mysql/centos/docker-entrypoint.sh @@ -5,7 +5,7 @@ set -o pipefail set +e # Script trace mode -if [ "${DEBUG_MODE}" == "true" ]; then +if [ "${DEBUG_MODE,,}" == "true" ]; then set -o xtrace fi @@ -66,17 +66,17 @@ check_variables() { file_env MYSQL_USER file_env MYSQL_PASSWORD - if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD}" == "true" ]; then + if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD,,}" == "true" ]; then echo "**** Impossible to use MySQL server because of unknown Zabbix user and random 'root' password" exit 1 fi - if [ ! -n "${MYSQL_USER}" ] && [ ! -n "${MYSQL_ROOT_PASSWORD}" ] && [ "${MYSQL_ALLOW_EMPTY_PASSWORD}" != "true" ]; then + if [ ! -n "${MYSQL_USER}" ] && [ ! -n "${MYSQL_ROOT_PASSWORD}" ] && [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" != "true" ]; then echo "*** Impossible to use MySQL server because 'root' password is not defined and it is not empty" exit 1 fi - if [ "${MYSQL_ALLOW_EMPTY_PASSWORD}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then + if [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then USE_DB_ROOT_USER=true DB_SERVER_ROOT_USER="root" DB_SERVER_ROOT_PASS=${MYSQL_ROOT_PASSWORD:-""} @@ -85,8 +85,8 @@ check_variables() { [ -n "${MYSQL_USER}" ] && CREATE_ZBX_DB_USER=true # If root password is not specified use provided credentials - : ${DB_SERVER_ROOT_USER:=${MYSQL_USER}}.... - [ "${MYSQL_ALLOW_EMPTY_PASSWORD}" == "true" ] || DB_SERVER_ROOT_PASS=${DB_SERVER_ROOT_PASS:-${MYSQL_PASSWORD}} + : ${DB_SERVER_ROOT_USER:=${MYSQL_USER}} + [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || DB_SERVER_ROOT_PASS=${DB_SERVER_ROOT_PASS:-${MYSQL_PASSWORD}} DB_SERVER_ZBX_USER=${MYSQL_USER:-"zabbix"} DB_SERVER_ZBX_PASS=${MYSQL_PASSWORD:-"zabbix"} @@ -98,7 +98,7 @@ check_db_connect() { echo "* DB_SERVER_HOST: ${DB_SERVER_HOST}" echo "* DB_SERVER_PORT: ${DB_SERVER_PORT}" echo "* DB_SERVER_DBNAME: ${DB_SERVER_DBNAME}" - if [ "${DEBUG_MODE}" == "true" ]; then + if [ "${DEBUG_MODE,,}" == "true" ]; then if [ "${USE_DB_ROOT_USER}" == "true" ]; then echo "* DB_SERVER_ROOT_USER: ${DB_SERVER_ROOT_USER}" echo "* DB_SERVER_ROOT_PASS: ${DB_SERVER_ROOT_PASS}" @@ -189,7 +189,9 @@ prepare_zbx_web_config() { "$ZABBIX_ETC_DIR/nginx_ssl.conf" fi - if [ "${ENABLE_WEB_ACCESS_LOG:-"true"}" == "false" ]; then + ENABLE_WEB_ACCESS_LOG=${ENABLE_WEB_ACCESS_LOG:-"true"} + + if [ "${ENABLE_WEB_ACCESS_LOG,,}" == "false" ]; then sed -ri \ -e 's!^(\s*access_log).+\;!\1 off\;!g' \ "/etc/nginx/nginx.conf" diff --git a/web-nginx-mysql/ubuntu/docker-entrypoint.sh b/web-nginx-mysql/ubuntu/docker-entrypoint.sh index 9be717bf3..f62b2233d 100755 --- a/web-nginx-mysql/ubuntu/docker-entrypoint.sh +++ b/web-nginx-mysql/ubuntu/docker-entrypoint.sh @@ -5,7 +5,7 @@ set -o pipefail set +e # Script trace mode -if [ "${DEBUG_MODE}" == "true" ]; then +if [ "${DEBUG_MODE,,}" == "true" ]; then set -o xtrace fi @@ -66,17 +66,17 @@ check_variables() { file_env MYSQL_USER file_env MYSQL_PASSWORD - if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD}" == "true" ]; then + if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD,,}" == "true" ]; then echo "**** Impossible to use MySQL server because of unknown Zabbix user and random 'root' password" exit 1 fi - if [ ! -n "${MYSQL_USER}" ] && [ ! -n "${MYSQL_ROOT_PASSWORD}" ] && [ "${MYSQL_ALLOW_EMPTY_PASSWORD}" != "true" ]; then + if [ ! -n "${MYSQL_USER}" ] && [ ! -n "${MYSQL_ROOT_PASSWORD}" ] && [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" != "true" ]; then echo "*** Impossible to use MySQL server because 'root' password is not defined and it is not empty" exit 1 fi - if [ "${MYSQL_ALLOW_EMPTY_PASSWORD}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then + if [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then USE_DB_ROOT_USER=true DB_SERVER_ROOT_USER="root" DB_SERVER_ROOT_PASS=${MYSQL_ROOT_PASSWORD:-""} @@ -85,8 +85,8 @@ check_variables() { [ -n "${MYSQL_USER}" ] && CREATE_ZBX_DB_USER=true # If root password is not specified use provided credentials - : ${DB_SERVER_ROOT_USER:=${MYSQL_USER}}.... - [ "${MYSQL_ALLOW_EMPTY_PASSWORD}" == "true" ] || DB_SERVER_ROOT_PASS=${DB_SERVER_ROOT_PASS:-${MYSQL_PASSWORD}} + : ${DB_SERVER_ROOT_USER:=${MYSQL_USER}} + [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || DB_SERVER_ROOT_PASS=${DB_SERVER_ROOT_PASS:-${MYSQL_PASSWORD}} DB_SERVER_ZBX_USER=${MYSQL_USER:-"zabbix"} DB_SERVER_ZBX_PASS=${MYSQL_PASSWORD:-"zabbix"} @@ -98,7 +98,7 @@ check_db_connect() { echo "* DB_SERVER_HOST: ${DB_SERVER_HOST}" echo "* DB_SERVER_PORT: ${DB_SERVER_PORT}" echo "* DB_SERVER_DBNAME: ${DB_SERVER_DBNAME}" - if [ "${DEBUG_MODE}" == "true" ]; then + if [ "${DEBUG_MODE,,}" == "true" ]; then if [ "${USE_DB_ROOT_USER}" == "true" ]; then echo "* DB_SERVER_ROOT_USER: ${DB_SERVER_ROOT_USER}" echo "* DB_SERVER_ROOT_PASS: ${DB_SERVER_ROOT_PASS}" @@ -189,7 +189,9 @@ prepare_zbx_web_config() { "$ZABBIX_ETC_DIR/nginx_ssl.conf" fi - if [ "${ENABLE_WEB_ACCESS_LOG:-"true"}" == "false" ]; then + ENABLE_WEB_ACCESS_LOG=${ENABLE_WEB_ACCESS_LOG:-"true"} + + if [ "${ENABLE_WEB_ACCESS_LOG,,}" == "false" ]; then sed -ri \ -e 's!^(\s*access_log).+\;!\1 off\;!g' \ "/etc/nginx/nginx.conf" diff --git a/web-nginx-pgsql/alpine/docker-entrypoint.sh b/web-nginx-pgsql/alpine/docker-entrypoint.sh index 8adf447e5..05ed641db 100755 --- a/web-nginx-pgsql/alpine/docker-entrypoint.sh +++ b/web-nginx-pgsql/alpine/docker-entrypoint.sh @@ -5,7 +5,7 @@ set -o pipefail set +e # Script trace mode -if [ "${DEBUG_MODE}" == "true" ]; then +if [ "${DEBUG_MODE,,}" == "true" ]; then set -o xtrace fi @@ -83,7 +83,7 @@ check_db_connect() { echo "* DB_SERVER_PORT: ${DB_SERVER_PORT}" echo "* DB_SERVER_DBNAME: ${DB_SERVER_DBNAME}" echo "* DB_SERVER_SCHEMA: ${DB_SERVER_SCHEMA}" - if [ "${DEBUG_MODE}" == "true" ]; then + if [ "${DEBUG_MODE,,}" == "true" ]; then if [ "${USE_DB_ROOT_USER}" == "true" ]; then echo "* DB_SERVER_ROOT_USER: ${DB_SERVER_ROOT_USER}" echo "* DB_SERVER_ROOT_PASS: ${DB_SERVER_ROOT_PASS}" @@ -186,7 +186,9 @@ prepare_zbx_web_config() { "$ZABBIX_ETC_DIR/nginx_ssl.conf" fi - if [ "${ENABLE_WEB_ACCESS_LOG:-"true"}" == "false" ]; then + ENABLE_WEB_ACCESS_LOG=${ENABLE_WEB_ACCESS_LOG:-"true"} + + if [ "${ENABLE_WEB_ACCESS_LOG,,}" == "false" ]; then sed -ri \ -e 's!^(\s*access_log).+\;!\1 off\;!g' \ "/etc/nginx/nginx.conf" diff --git a/web-nginx-pgsql/centos/docker-entrypoint.sh b/web-nginx-pgsql/centos/docker-entrypoint.sh index a61df4f45..296db45ec 100755 --- a/web-nginx-pgsql/centos/docker-entrypoint.sh +++ b/web-nginx-pgsql/centos/docker-entrypoint.sh @@ -5,7 +5,7 @@ set -o pipefail set +e # Script trace mode -if [ "${DEBUG_MODE}" == "true" ]; then +if [ "${DEBUG_MODE,,}" == "true" ]; then set -o xtrace fi @@ -83,7 +83,7 @@ check_db_connect() { echo "* DB_SERVER_PORT: ${DB_SERVER_PORT}" echo "* DB_SERVER_DBNAME: ${DB_SERVER_DBNAME}" echo "* DB_SERVER_SCHEMA: ${DB_SERVER_SCHEMA}" - if [ "${DEBUG_MODE}" == "true" ]; then + if [ "${DEBUG_MODE,,}" == "true" ]; then if [ "${USE_DB_ROOT_USER}" == "true" ]; then echo "* DB_SERVER_ROOT_USER: ${DB_SERVER_ROOT_USER}" echo "* DB_SERVER_ROOT_PASS: ${DB_SERVER_ROOT_PASS}" @@ -186,7 +186,9 @@ prepare_zbx_web_config() { "$ZABBIX_ETC_DIR/nginx_ssl.conf" fi - if [ "${ENABLE_WEB_ACCESS_LOG:-"true"}" == "false" ]; then + ENABLE_WEB_ACCESS_LOG=${ENABLE_WEB_ACCESS_LOG:-"true"} + + if [ "${ENABLE_WEB_ACCESS_LOG,,}" == "false" ]; then sed -ri \ -e 's!^(\s*access_log).+\;!\1 off\;!g' \ "/etc/nginx/nginx.conf" diff --git a/web-nginx-pgsql/ubuntu/docker-entrypoint.sh b/web-nginx-pgsql/ubuntu/docker-entrypoint.sh index db1c55418..491cf1541 100755 --- a/web-nginx-pgsql/ubuntu/docker-entrypoint.sh +++ b/web-nginx-pgsql/ubuntu/docker-entrypoint.sh @@ -5,7 +5,7 @@ set -o pipefail set +e # Script trace mode -if [ "${DEBUG_MODE}" == "true" ]; then +if [ "${DEBUG_MODE,,}" == "true" ]; then set -o xtrace fi @@ -83,7 +83,7 @@ check_db_connect() { echo "* DB_SERVER_PORT: ${DB_SERVER_PORT}" echo "* DB_SERVER_DBNAME: ${DB_SERVER_DBNAME}" echo "* DB_SERVER_SCHEMA: ${DB_SERVER_SCHEMA}" - if [ "${DEBUG_MODE}" == "true" ]; then + if [ "${DEBUG_MODE,,}" == "true" ]; then if [ "${USE_DB_ROOT_USER}" == "true" ]; then echo "* DB_SERVER_ROOT_USER: ${DB_SERVER_ROOT_USER}" echo "* DB_SERVER_ROOT_PASS: ${DB_SERVER_ROOT_PASS}" @@ -186,7 +186,9 @@ prepare_zbx_web_config() { "$ZABBIX_ETC_DIR/nginx_ssl.conf" fi - if [ "${ENABLE_WEB_ACCESS_LOG:-"true"}" == "false" ]; then + ENABLE_WEB_ACCESS_LOG=${ENABLE_WEB_ACCESS_LOG:-"true"} + + if [ "${ENABLE_WEB_ACCESS_LOG,,}" == "false" ]; then sed -ri \ -e 's!^(\s*access_log).+\;!\1 off\;!g' \ "/etc/nginx/nginx.conf" From 8160056240fdce062c437c579d78b826d1af58a9 Mon Sep 17 00:00:00 2001 From: Alexey Pustovalov Date: Tue, 13 Apr 2021 07:09:40 -0400 Subject: [PATCH 4/4] Ignore case for boolean vars --- web-apache-mysql/alpine/docker-entrypoint.sh | 5 +++-- web-apache-mysql/centos/docker-entrypoint.sh | 5 +++-- web-apache-mysql/ubuntu/docker-entrypoint.sh | 5 +++-- web-apache-pgsql/alpine/docker-entrypoint.sh | 5 +++-- web-apache-pgsql/centos/docker-entrypoint.sh | 5 +++-- web-apache-pgsql/ubuntu/docker-entrypoint.sh | 5 +++-- web-nginx-mysql/alpine/docker-entrypoint.sh | 5 +++-- web-nginx-mysql/centos/docker-entrypoint.sh | 5 +++-- web-nginx-mysql/ubuntu/docker-entrypoint.sh | 5 +++-- web-nginx-pgsql/alpine/docker-entrypoint.sh | 5 +++-- web-nginx-pgsql/centos/docker-entrypoint.sh | 5 +++-- web-nginx-pgsql/ubuntu/docker-entrypoint.sh | 5 +++-- 12 files changed, 36 insertions(+), 24 deletions(-) diff --git a/web-apache-mysql/alpine/docker-entrypoint.sh b/web-apache-mysql/alpine/docker-entrypoint.sh index 9a756f51c..0a43f7f5e 100755 --- a/web-apache-mysql/alpine/docker-entrypoint.sh +++ b/web-apache-mysql/alpine/docker-entrypoint.sh @@ -146,7 +146,8 @@ prepare_web_server() { prepare_zbx_web_config() { echo "** Preparing Zabbix frontend configuration file" - export ZBX_DENY_GUI_ACCESS=${ZBX_DENY_GUI_ACCESS:-"false"} + : ${ZBX_DENY_GUI_ACCESS:="false"} + export ZBX_DENY_GUI_ACCESS=${ZBX_DENY_GUI_ACCESS,,} export ZBX_GUI_ACCESS_IP_RANGE=${ZBX_GUI_ACCESS_IP_RANGE:-"['127.0.0.1']"} export ZBX_GUI_WARNING_MSG=${ZBX_GUI_WARNING_MSG:-"Zabbix is under maintenance."} @@ -168,7 +169,7 @@ prepare_zbx_web_config() { export ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"} export ZBX_SERVER_NAME=${ZBX_SERVER_NAME} - ENABLE_WEB_ACCESS_LOG=${ENABLE_WEB_ACCESS_LOG:-"true"} + : ${ENABLE_WEB_ACCESS_LOG:="true"} if [ "${ENABLE_WEB_ACCESS_LOG,,}" == "false" ]; then sed -ri \ diff --git a/web-apache-mysql/centos/docker-entrypoint.sh b/web-apache-mysql/centos/docker-entrypoint.sh index 5ff556d2d..1c34c3337 100755 --- a/web-apache-mysql/centos/docker-entrypoint.sh +++ b/web-apache-mysql/centos/docker-entrypoint.sh @@ -146,7 +146,8 @@ prepare_web_server() { prepare_zbx_web_config() { echo "** Preparing Zabbix frontend configuration file" - export ZBX_DENY_GUI_ACCESS=${ZBX_DENY_GUI_ACCESS:-"false"} + : ${ZBX_DENY_GUI_ACCESS:="false"} + export ZBX_DENY_GUI_ACCESS=${ZBX_DENY_GUI_ACCESS,,} export ZBX_GUI_ACCESS_IP_RANGE=${ZBX_GUI_ACCESS_IP_RANGE:-"['127.0.0.1']"} export ZBX_GUI_WARNING_MSG=${ZBX_GUI_WARNING_MSG:-"Zabbix is under maintenance."} @@ -168,7 +169,7 @@ prepare_zbx_web_config() { export ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"} export ZBX_SERVER_NAME=${ZBX_SERVER_NAME} - ENABLE_WEB_ACCESS_LOG=${ENABLE_WEB_ACCESS_LOG:-"true"} + : ${ENABLE_WEB_ACCESS_LOG:="true"} if [ "${ENABLE_WEB_ACCESS_LOG,,}" == "false" ]; then sed -ri \ diff --git a/web-apache-mysql/ubuntu/docker-entrypoint.sh b/web-apache-mysql/ubuntu/docker-entrypoint.sh index b42a664ca..1b5368504 100755 --- a/web-apache-mysql/ubuntu/docker-entrypoint.sh +++ b/web-apache-mysql/ubuntu/docker-entrypoint.sh @@ -146,7 +146,8 @@ prepare_web_server() { prepare_zbx_web_config() { echo "** Preparing Zabbix frontend configuration file" - export ZBX_DENY_GUI_ACCESS=${ZBX_DENY_GUI_ACCESS:-"false"} + : ${ZBX_DENY_GUI_ACCESS:="false"} + export ZBX_DENY_GUI_ACCESS=${ZBX_DENY_GUI_ACCESS,,} export ZBX_GUI_ACCESS_IP_RANGE=${ZBX_GUI_ACCESS_IP_RANGE:-"['127.0.0.1']"} export ZBX_GUI_WARNING_MSG=${ZBX_GUI_WARNING_MSG:-"Zabbix is under maintenance."} @@ -168,7 +169,7 @@ prepare_zbx_web_config() { export ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"} export ZBX_SERVER_NAME=${ZBX_SERVER_NAME} - ENABLE_WEB_ACCESS_LOG=${ENABLE_WEB_ACCESS_LOG:-"true"} + : ${ENABLE_WEB_ACCESS_LOG:="true"} if [ "${ENABLE_WEB_ACCESS_LOG,,}" == "false" ]; then sed -ri \ diff --git a/web-apache-pgsql/alpine/docker-entrypoint.sh b/web-apache-pgsql/alpine/docker-entrypoint.sh index b0d793525..4acb62af1 100755 --- a/web-apache-pgsql/alpine/docker-entrypoint.sh +++ b/web-apache-pgsql/alpine/docker-entrypoint.sh @@ -143,7 +143,8 @@ prepare_web_server() { prepare_zbx_web_config() { echo "** Preparing Zabbix frontend configuration file" - export ZBX_DENY_GUI_ACCESS=${ZBX_DENY_GUI_ACCESS:-"false"} + : ${ZBX_DENY_GUI_ACCESS:="false"} + export ZBX_DENY_GUI_ACCESS=${ZBX_DENY_GUI_ACCESS,,} export ZBX_GUI_ACCESS_IP_RANGE=${ZBX_GUI_ACCESS_IP_RANGE:-"['127.0.0.1']"} export ZBX_GUI_WARNING_MSG=${ZBX_GUI_WARNING_MSG:-"Zabbix is under maintenance."} @@ -165,7 +166,7 @@ prepare_zbx_web_config() { export ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"} export ZBX_SERVER_NAME=${ZBX_SERVER_NAME} - ENABLE_WEB_ACCESS_LOG=${ENABLE_WEB_ACCESS_LOG:-"true"} + : ${ENABLE_WEB_ACCESS_LOG:="true"} if [ "${ENABLE_WEB_ACCESS_LOG,,}" == "false" ]; then sed -ri \ diff --git a/web-apache-pgsql/centos/docker-entrypoint.sh b/web-apache-pgsql/centos/docker-entrypoint.sh index e8eac21b6..bbace0663 100755 --- a/web-apache-pgsql/centos/docker-entrypoint.sh +++ b/web-apache-pgsql/centos/docker-entrypoint.sh @@ -143,7 +143,8 @@ prepare_web_server() { prepare_zbx_web_config() { echo "** Preparing Zabbix frontend configuration file" - export ZBX_DENY_GUI_ACCESS=${ZBX_DENY_GUI_ACCESS:-"false"} + : ${ZBX_DENY_GUI_ACCESS:="false"} + export ZBX_DENY_GUI_ACCESS=${ZBX_DENY_GUI_ACCESS,,} export ZBX_GUI_ACCESS_IP_RANGE=${ZBX_GUI_ACCESS_IP_RANGE:-"['127.0.0.1']"} export ZBX_GUI_WARNING_MSG=${ZBX_GUI_WARNING_MSG:-"Zabbix is under maintenance."} @@ -165,7 +166,7 @@ prepare_zbx_web_config() { export ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"} export ZBX_SERVER_NAME=${ZBX_SERVER_NAME} - ENABLE_WEB_ACCESS_LOG=${ENABLE_WEB_ACCESS_LOG:-"true"} + : ${ENABLE_WEB_ACCESS_LOG:="true"} if [ "${ENABLE_WEB_ACCESS_LOG,,}" == "false" ]; then sed -ri \ diff --git a/web-apache-pgsql/ubuntu/docker-entrypoint.sh b/web-apache-pgsql/ubuntu/docker-entrypoint.sh index d738a5f3c..3960dec72 100755 --- a/web-apache-pgsql/ubuntu/docker-entrypoint.sh +++ b/web-apache-pgsql/ubuntu/docker-entrypoint.sh @@ -143,7 +143,8 @@ prepare_web_server() { prepare_zbx_web_config() { echo "** Preparing Zabbix frontend configuration file" - export ZBX_DENY_GUI_ACCESS=${ZBX_DENY_GUI_ACCESS:-"false"} + : ${ZBX_DENY_GUI_ACCESS:="false"} + export ZBX_DENY_GUI_ACCESS=${ZBX_DENY_GUI_ACCESS,,} export ZBX_GUI_ACCESS_IP_RANGE=${ZBX_GUI_ACCESS_IP_RANGE:-"['127.0.0.1']"} export ZBX_GUI_WARNING_MSG=${ZBX_GUI_WARNING_MSG:-"Zabbix is under maintenance."} @@ -165,7 +166,7 @@ prepare_zbx_web_config() { export ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"} export ZBX_SERVER_NAME=${ZBX_SERVER_NAME} - ENABLE_WEB_ACCESS_LOG=${ENABLE_WEB_ACCESS_LOG:-"true"} + : ${ENABLE_WEB_ACCESS_LOG:="true"} if [ "${ENABLE_WEB_ACCESS_LOG,,}" == "false" ]; then sed -ri \ diff --git a/web-nginx-mysql/alpine/docker-entrypoint.sh b/web-nginx-mysql/alpine/docker-entrypoint.sh index d7de2624d..771cfe61f 100755 --- a/web-nginx-mysql/alpine/docker-entrypoint.sh +++ b/web-nginx-mysql/alpine/docker-entrypoint.sh @@ -156,7 +156,8 @@ prepare_zbx_web_config() { echo "listen.group = nginx" >> "$PHP_CONFIG_FILE" fi - export ZBX_DENY_GUI_ACCESS=${ZBX_DENY_GUI_ACCESS:-"false"} + : ${ZBX_DENY_GUI_ACCESS:="false"} + export ZBX_DENY_GUI_ACCESS=${ZBX_DENY_GUI_ACCESS,,} export ZBX_GUI_ACCESS_IP_RANGE=${ZBX_GUI_ACCESS_IP_RANGE:-"['127.0.0.1']"} export ZBX_GUI_WARNING_MSG=${ZBX_GUI_WARNING_MSG:-"Zabbix is under maintenance."} @@ -189,7 +190,7 @@ prepare_zbx_web_config() { "$ZABBIX_ETC_DIR/nginx_ssl.conf" fi - ENABLE_WEB_ACCESS_LOG=${ENABLE_WEB_ACCESS_LOG:-"true"} + : ${ENABLE_WEB_ACCESS_LOG:="true"} if [ "${ENABLE_WEB_ACCESS_LOG,,}" == "false" ]; then sed -ri \ diff --git a/web-nginx-mysql/centos/docker-entrypoint.sh b/web-nginx-mysql/centos/docker-entrypoint.sh index bb70db748..dc6c7b6f3 100755 --- a/web-nginx-mysql/centos/docker-entrypoint.sh +++ b/web-nginx-mysql/centos/docker-entrypoint.sh @@ -156,7 +156,8 @@ prepare_zbx_web_config() { echo "listen.group = nginx" >> "$PHP_CONFIG_FILE" fi - export ZBX_DENY_GUI_ACCESS=${ZBX_DENY_GUI_ACCESS:-"false"} + : ${ZBX_DENY_GUI_ACCESS:="false"} + export ZBX_DENY_GUI_ACCESS=${ZBX_DENY_GUI_ACCESS,,} export ZBX_GUI_ACCESS_IP_RANGE=${ZBX_GUI_ACCESS_IP_RANGE:-"['127.0.0.1']"} export ZBX_GUI_WARNING_MSG=${ZBX_GUI_WARNING_MSG:-"Zabbix is under maintenance."} @@ -189,7 +190,7 @@ prepare_zbx_web_config() { "$ZABBIX_ETC_DIR/nginx_ssl.conf" fi - ENABLE_WEB_ACCESS_LOG=${ENABLE_WEB_ACCESS_LOG:-"true"} + : ${ENABLE_WEB_ACCESS_LOG:="true"} if [ "${ENABLE_WEB_ACCESS_LOG,,}" == "false" ]; then sed -ri \ diff --git a/web-nginx-mysql/ubuntu/docker-entrypoint.sh b/web-nginx-mysql/ubuntu/docker-entrypoint.sh index f62b2233d..338191b85 100755 --- a/web-nginx-mysql/ubuntu/docker-entrypoint.sh +++ b/web-nginx-mysql/ubuntu/docker-entrypoint.sh @@ -156,7 +156,8 @@ prepare_zbx_web_config() { echo "listen.group = nginx" >> "$PHP_CONFIG_FILE" fi - export ZBX_DENY_GUI_ACCESS=${ZBX_DENY_GUI_ACCESS:-"false"} + : ${ZBX_DENY_GUI_ACCESS:="false"} + export ZBX_DENY_GUI_ACCESS=${ZBX_DENY_GUI_ACCESS,,} export ZBX_GUI_ACCESS_IP_RANGE=${ZBX_GUI_ACCESS_IP_RANGE:-"['127.0.0.1']"} export ZBX_GUI_WARNING_MSG=${ZBX_GUI_WARNING_MSG:-"Zabbix is under maintenance."} @@ -189,7 +190,7 @@ prepare_zbx_web_config() { "$ZABBIX_ETC_DIR/nginx_ssl.conf" fi - ENABLE_WEB_ACCESS_LOG=${ENABLE_WEB_ACCESS_LOG:-"true"} + : ${ENABLE_WEB_ACCESS_LOG:="true"} if [ "${ENABLE_WEB_ACCESS_LOG,,}" == "false" ]; then sed -ri \ diff --git a/web-nginx-pgsql/alpine/docker-entrypoint.sh b/web-nginx-pgsql/alpine/docker-entrypoint.sh index 05ed641db..06cb140e6 100755 --- a/web-nginx-pgsql/alpine/docker-entrypoint.sh +++ b/web-nginx-pgsql/alpine/docker-entrypoint.sh @@ -153,7 +153,8 @@ prepare_zbx_web_config() { echo "listen.group = nginx" >> "$PHP_CONFIG_FILE" fi - export ZBX_DENY_GUI_ACCESS=${ZBX_DENY_GUI_ACCESS:-"false"} + : ${ZBX_DENY_GUI_ACCESS:="false"} + export ZBX_DENY_GUI_ACCESS=${ZBX_DENY_GUI_ACCESS,,} export ZBX_GUI_ACCESS_IP_RANGE=${ZBX_GUI_ACCESS_IP_RANGE:-"['127.0.0.1']"} export ZBX_GUI_WARNING_MSG=${ZBX_GUI_WARNING_MSG:-"Zabbix is under maintenance."} @@ -186,7 +187,7 @@ prepare_zbx_web_config() { "$ZABBIX_ETC_DIR/nginx_ssl.conf" fi - ENABLE_WEB_ACCESS_LOG=${ENABLE_WEB_ACCESS_LOG:-"true"} + : ${ENABLE_WEB_ACCESS_LOG:="true"} if [ "${ENABLE_WEB_ACCESS_LOG,,}" == "false" ]; then sed -ri \ diff --git a/web-nginx-pgsql/centos/docker-entrypoint.sh b/web-nginx-pgsql/centos/docker-entrypoint.sh index 296db45ec..ec2b40a90 100755 --- a/web-nginx-pgsql/centos/docker-entrypoint.sh +++ b/web-nginx-pgsql/centos/docker-entrypoint.sh @@ -153,7 +153,8 @@ prepare_zbx_web_config() { echo "listen.group = nginx" >> "$PHP_CONFIG_FILE" fi - export ZBX_DENY_GUI_ACCESS=${ZBX_DENY_GUI_ACCESS:-"false"} + : ${ZBX_DENY_GUI_ACCESS:="false"} + export ZBX_DENY_GUI_ACCESS=${ZBX_DENY_GUI_ACCESS,,} export ZBX_GUI_ACCESS_IP_RANGE=${ZBX_GUI_ACCESS_IP_RANGE:-"['127.0.0.1']"} export ZBX_GUI_WARNING_MSG=${ZBX_GUI_WARNING_MSG:-"Zabbix is under maintenance."} @@ -186,7 +187,7 @@ prepare_zbx_web_config() { "$ZABBIX_ETC_DIR/nginx_ssl.conf" fi - ENABLE_WEB_ACCESS_LOG=${ENABLE_WEB_ACCESS_LOG:-"true"} + : ${ENABLE_WEB_ACCESS_LOG:="true"} if [ "${ENABLE_WEB_ACCESS_LOG,,}" == "false" ]; then sed -ri \ diff --git a/web-nginx-pgsql/ubuntu/docker-entrypoint.sh b/web-nginx-pgsql/ubuntu/docker-entrypoint.sh index 491cf1541..e274bdb52 100755 --- a/web-nginx-pgsql/ubuntu/docker-entrypoint.sh +++ b/web-nginx-pgsql/ubuntu/docker-entrypoint.sh @@ -153,7 +153,8 @@ prepare_zbx_web_config() { echo "listen.group = nginx" >> "$PHP_CONFIG_FILE" fi - export ZBX_DENY_GUI_ACCESS=${ZBX_DENY_GUI_ACCESS:-"false"} + : ${ZBX_DENY_GUI_ACCESS:="false"} + export ZBX_DENY_GUI_ACCESS=${ZBX_DENY_GUI_ACCESS,,} export ZBX_GUI_ACCESS_IP_RANGE=${ZBX_GUI_ACCESS_IP_RANGE:-"['127.0.0.1']"} export ZBX_GUI_WARNING_MSG=${ZBX_GUI_WARNING_MSG:-"Zabbix is under maintenance."} @@ -186,7 +187,7 @@ prepare_zbx_web_config() { "$ZABBIX_ETC_DIR/nginx_ssl.conf" fi - ENABLE_WEB_ACCESS_LOG=${ENABLE_WEB_ACCESS_LOG:-"true"} + : ${ENABLE_WEB_ACCESS_LOG:="true"} if [ "${ENABLE_WEB_ACCESS_LOG,,}" == "false" ]; then sed -ri \