zabbix-docker/Dockerfiles/java-gateway/alpine/docker-entrypoint.sh

43 lines
894 B
Bash
Raw Normal View History

2016-08-03 10:09:49 +02:00
#!/bin/bash
set -o pipefail
2018-02-18 21:42:44 +01:00
2016-08-03 10:09:49 +02:00
set +e
2016-08-04 07:09:11 +02:00
# Script trace mode
2021-04-12 03:43:41 +02:00
if [ "${DEBUG_MODE,,}" == "true" ]; then
2016-08-04 07:09:11 +02:00
set -o xtrace
fi
2016-08-03 10:09:49 +02:00
# Default directories
# Configuration files directory
2016-08-03 10:09:49 +02:00
ZABBIX_ETC_DIR="/etc/zabbix"
prepare_java_gateway_config() {
echo "** Preparing Zabbix Java Gateway log configuration file"
ZBX_GATEWAY_CONFIG=$ZABBIX_ETC_DIR/zabbix_java_gateway_logback.xml
2021-09-13 17:44:52 +02:00
: ${ZBX_DEBUGLEVEL:="info"}
echo "Updating $ZBX_GATEWAY_CONFIG 'DebugLevel' parameter: '${ZBX_DEBUGLEVEL}'... updated"
sed -i -e "/^.*<root level=/s/=.*/=\"${ZBX_DEBUGLEVEL}\">/" "$ZBX_GATEWAY_CONFIG"
2016-08-03 10:09:49 +02:00
}
prepare_java_gateway() {
echo "** Preparing Zabbix Java Gateway"
prepare_java_gateway_config
}
#################################################
if [ "$1" == '/usr/sbin/zabbix_java_gateway' ]; then
prepare_java_gateway
fi
2016-08-03 10:09:49 +02:00
exec "$@"
2016-08-03 10:09:49 +02:00
2016-08-03 10:09:49 +02:00
#################################################