2016-08-03 10:09:49 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2019-10-03 16:08:57 +02:00
|
|
|
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
|
|
|
|
2016-08-11 12:55:45 +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
|
2016-08-11 12:55:45 +02:00
|
|
|
# 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
|
|
|
|
}
|
|
|
|
|
|
|
|
#################################################
|
|
|
|
|
2019-10-03 17:16:08 +02:00
|
|
|
if [ "$1" == '/usr/sbin/zabbix_java_gateway' ]; then
|
|
|
|
prepare_java_gateway
|
|
|
|
fi
|
2016-08-03 10:09:49 +02:00
|
|
|
|
2019-10-03 16:08:57 +02:00
|
|
|
exec "$@"
|
2016-08-03 10:09:49 +02:00
|
|
|
|
2019-10-03 17:16:08 +02:00
|
|
|
|
2016-08-03 10:09:49 +02:00
|
|
|
#################################################
|