zabbix_agentd: By default only listen on GREEN ip

- Change zabbix_agentd.conf during install to only listen on the
  GREEN ip by default.

Signed-off-by: Robin Roevens <robin.roevens@disroot.org>
This commit is contained in:
Robin Roevens
2022-06-30 12:15:54 +02:00
committed by Peter Müller
parent 092330b128
commit 1898c66a48
2 changed files with 13 additions and 0 deletions

View File

@@ -77,4 +77,14 @@ if [ $? -eq 1 ]; then
echo "Include=/var/ipfire/zabbix_agentd/zabbix_agentd_ipfire_mandatory.conf" >> /etc/zabbix_agentd/zabbix_agentd.conf
fi
# By default, only listen on GREEN
(
eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings)
if [ -n "${GREEN_ADDRESS}" ]; then
sed -i -e "s|ListenIP=GREEN_ADDRESS|ListenIP=${GREEN_ADDRESS}|g" /etc/zabbix_agentd/zabbix_agentd.conf
else
sed -i -e "\|ListenIP=GREEN_ADDRESS|d" /etc/zabbix_agentd/zabbix_agentd.conf
fi
) || :
start_service --background ${NAME}