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"