mirror of
https://github.com/zabbix/zabbix-docker.git
synced 2025-01-03 04:09:31 +01:00
Sync bash code with 7.2 version
This commit is contained in:
parent
2459744d15
commit
9f682471bb
@ -83,16 +83,20 @@ update_config_var() {
|
||||
echo -n "** Updating '$config_path' parameter \"$var_name\": '$var_value'..."
|
||||
fi
|
||||
|
||||
# Remove configuration parameter definition in case of unset parameter value
|
||||
# Remove configuration parameter definition in case of unset or empty parameter value
|
||||
if [ -z "$var_value" ]; then
|
||||
sed -i -e "/^$var_name=/d" "$config_path"
|
||||
echo "removed"
|
||||
return
|
||||
fi
|
||||
|
||||
# Remove value from configuration parameter in case of double quoted parameter value
|
||||
if [ "$var_value" == '""' ]; then
|
||||
sed -i -e "/^$var_name=/s/=.*/=/" "$config_path"
|
||||
# Remove value from configuration parameter in case of set to double quoted parameter value
|
||||
if [[ "$var_value" == '""' ]]; then
|
||||
if [ "$(grep -E "^$var_name=" $config_path)" ]; then
|
||||
sed -i -e "/^$var_name=/s/=.*/=/" "$config_path"
|
||||
else
|
||||
sed -i -e "/^[#;] $var_name=/s/.*/&\n$var_name=/" "$config_path"
|
||||
fi
|
||||
echo "undefined"
|
||||
return
|
||||
fi
|
||||
|
@ -83,16 +83,20 @@ update_config_var() {
|
||||
echo -n "** Updating '$config_path' parameter \"$var_name\": '$var_value'..."
|
||||
fi
|
||||
|
||||
# Remove configuration parameter definition in case of unset parameter value
|
||||
# Remove configuration parameter definition in case of unset or empty parameter value
|
||||
if [ -z "$var_value" ]; then
|
||||
sed -i -e "/^$var_name=/d" "$config_path"
|
||||
echo "removed"
|
||||
return
|
||||
fi
|
||||
|
||||
# Remove value from configuration parameter in case of double quoted parameter value
|
||||
if [ "$var_value" == '""' ]; then
|
||||
sed -i -e "/^$var_name=/s/=.*/=/" "$config_path"
|
||||
# Remove value from configuration parameter in case of set to double quoted parameter value
|
||||
if [[ "$var_value" == '""' ]]; then
|
||||
if [ "$(grep -E "^$var_name=" $config_path)" ]; then
|
||||
sed -i -e "/^$var_name=/s/=.*/=/" "$config_path"
|
||||
else
|
||||
sed -i -e "/^[#;] $var_name=/s/.*/&\n$var_name=/" "$config_path"
|
||||
fi
|
||||
echo "undefined"
|
||||
return
|
||||
fi
|
||||
|
@ -83,16 +83,20 @@ update_config_var() {
|
||||
echo -n "** Updating '$config_path' parameter \"$var_name\": '$var_value'..."
|
||||
fi
|
||||
|
||||
# Remove configuration parameter definition in case of unset parameter value
|
||||
# Remove configuration parameter definition in case of unset or empty parameter value
|
||||
if [ -z "$var_value" ]; then
|
||||
sed -i -e "/^$var_name=/d" "$config_path"
|
||||
echo "removed"
|
||||
return
|
||||
fi
|
||||
|
||||
# Remove value from configuration parameter in case of double quoted parameter value
|
||||
if [ "$var_value" == '""' ]; then
|
||||
sed -i -e "/^$var_name=/s/=.*/=/" "$config_path"
|
||||
# Remove value from configuration parameter in case of set to double quoted parameter value
|
||||
if [[ "$var_value" == '""' ]]; then
|
||||
if [ "$(grep -E "^$var_name=" $config_path)" ]; then
|
||||
sed -i -e "/^$var_name=/s/=.*/=/" "$config_path"
|
||||
else
|
||||
sed -i -e "/^[#;] $var_name=/s/.*/&\n$var_name=/" "$config_path"
|
||||
fi
|
||||
echo "undefined"
|
||||
return
|
||||
fi
|
||||
|
@ -83,16 +83,20 @@ update_config_var() {
|
||||
echo -n "** Updating '$config_path' parameter \"$var_name\": '$var_value'..."
|
||||
fi
|
||||
|
||||
# Remove configuration parameter definition in case of unset parameter value
|
||||
# Remove configuration parameter definition in case of unset or empty parameter value
|
||||
if [ -z "$var_value" ]; then
|
||||
sed -i -e "/^$var_name=/d" "$config_path"
|
||||
echo "removed"
|
||||
return
|
||||
fi
|
||||
|
||||
# Remove value from configuration parameter in case of double quoted parameter value
|
||||
if [ "$var_value" == '""' ]; then
|
||||
sed -i -e "/^$var_name=/s/=.*/=/" "$config_path"
|
||||
# Remove value from configuration parameter in case of set to double quoted parameter value
|
||||
if [[ "$var_value" == '""' ]]; then
|
||||
if [ "$(grep -E "^$var_name=" $config_path)" ]; then
|
||||
sed -i -e "/^$var_name=/s/=.*/=/" "$config_path"
|
||||
else
|
||||
sed -i -e "/^[#;] $var_name=/s/.*/&\n$var_name=/" "$config_path"
|
||||
fi
|
||||
echo "undefined"
|
||||
return
|
||||
fi
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
ZABBIX_TRAPS_FILE="/var/lib/zabbix/snmptraps/snmptraps.log"
|
||||
ZABBIX_TRAPS_FILE="${ZABBIX_USER_HOME_DIR}/snmptraps/snmptraps.log"
|
||||
|
||||
ZBX_SNMP_TRAP_DATE_FORMAT=${ZBX_SNMP_TRAP_DATE_FORMAT:-"+%Y%m%d.%H%M%S"}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
ZABBIX_TRAPS_FILE="/var/lib/zabbix/snmptraps/snmptraps.log"
|
||||
ZABBIX_TRAPS_FILE="${ZABBIX_USER_HOME_DIR}/snmptraps/snmptraps.log"
|
||||
|
||||
ZBX_SNMP_TRAP_DATE_FORMAT=${ZBX_SNMP_TRAP_DATE_FORMAT:-"+%Y%m%d.%H%M%S"}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
ZABBIX_TRAPS_FILE="/var/lib/zabbix/snmptraps/snmptraps.log"
|
||||
ZABBIX_TRAPS_FILE="${ZABBIX_USER_HOME_DIR}/snmptraps/snmptraps.log"
|
||||
|
||||
ZBX_SNMP_TRAP_DATE_FORMAT=${ZBX_SNMP_TRAP_DATE_FORMAT:-"+%Y%m%d.%H%M%S"}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
ZABBIX_TRAPS_FILE="/var/lib/zabbix/snmptraps/snmptraps.log"
|
||||
ZABBIX_TRAPS_FILE="${ZABBIX_USER_HOME_DIR}/snmptraps/snmptraps.log"
|
||||
|
||||
ZBX_SNMP_TRAP_DATE_FORMAT=${ZBX_SNMP_TRAP_DATE_FORMAT:-"+%Y%m%d.%H%M%S"}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
ZABBIX_TRAPS_FILE="/var/lib/zabbix/snmptraps/snmptraps.log"
|
||||
ZABBIX_TRAPS_FILE="${ZABBIX_USER_HOME_DIR}/snmptraps/snmptraps.log"
|
||||
|
||||
ZBX_SNMP_TRAP_DATE_FORMAT=${ZBX_SNMP_TRAP_DATE_FORMAT:-"+%Y%m%d.%H%M%S"}
|
||||
|
||||
|
@ -12,7 +12,6 @@ services:
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
- ${DATA_DIRECTORY}/usr/lib/zabbix/alertscripts:/usr/lib/zabbix/alertscripts:ro
|
||||
- ${DATA_DIRECTORY}/usr/lib/zabbix/externalscripts:/usr/lib/zabbix/externalscripts:ro
|
||||
- ${DATA_DIRECTORY}/var/lib/zabbix/dbscripts:/var/lib/zabbix/dbscripts:ro
|
||||
- ${DATA_DIRECTORY}/var/lib/zabbix/export:/var/lib/zabbix/export:rw
|
||||
- ${DATA_DIRECTORY}/var/lib/zabbix/modules:/var/lib/zabbix/modules:ro
|
||||
- ${DATA_DIRECTORY}/var/lib/zabbix/enc:/var/lib/zabbix/enc:ro
|
||||
@ -90,7 +89,8 @@ services:
|
||||
server-pgsql-db-init:
|
||||
init: true
|
||||
attach: true
|
||||
# volumes:
|
||||
volumes:
|
||||
- ${DATA_DIRECTORY}/var/lib/zabbix/dbscripts:/var/lib/zabbix/dbscripts:ro
|
||||
# - ${ENV_VARS_DIRECTORY}/.ZBX_DB_CA_FILE:/run/secrets/root-ca.pem:ro
|
||||
# - ${ENV_VARS_DIRECTORY}/.ZBX_DB_CERT_FILE:/run/secrets/client-cert.pem:ro
|
||||
# - ${ENV_VARS_DIRECTORY}/.ZBX_DB_KEY_FILE:/run/secrets/client-key.pem:ro
|
||||
|
Loading…
Reference in New Issue
Block a user