From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robin Roevens To: development@lists.ipfire.org Subject: [PATCH v4 5/6] zabbix_agentd: By default only listen on GREEN ip Date: Thu, 03 Mar 2022 22:02:53 +0100 Message-ID: <20220303210254.3116-6-robin.roevens@disroot.org> In-Reply-To: <20220303210254.3116-1-robin.roevens@disroot.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7817894201519525004==" List-Id: --===============7817894201519525004== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable - Change zabbix_agentd.conf during install to only listen on the GREEN ip by default. Signed-off-by: Robin Roevens --- config/zabbix_agentd/zabbix_agentd.conf | 3 +++ src/paks/zabbix_agentd/install.sh | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/config/zabbix_agentd/zabbix_agentd.conf b/config/zabbix_agentd/z= abbix_agentd.conf index 76cd87528..a12fe3a60 100644 --- a/config/zabbix_agentd/zabbix_agentd.conf +++ b/config/zabbix_agentd/zabbix_agentd.conf @@ -13,6 +13,9 @@ Server=3D127.0.0.1 ServerActive=3D127.0.0.1 =20 +# List of comma delimited IP addresses that the agent should listen on. +ListenIP=3DGREEN_ADDRESS + # This line activates IPFire specific userparameters. See IPFire wiki for de= tails. # To deactivate them: Comment this line out. # (DO NOT REMOVE OR ALTER IT as then it will be re-added on next upgrade) diff --git a/src/paks/zabbix_agentd/install.sh b/src/paks/zabbix_agentd/insta= ll.sh index d9130dfb4..a64d4c84f 100644 --- a/src/paks/zabbix_agentd/install.sh +++ b/src/paks/zabbix_agentd/install.sh @@ -76,4 +76,14 @@ if [ $? -eq 1 ]; then echo "Include=3D/var/ipfire/zabbix_agentd/zabbix_agentd_ipfire_mandatory.co= nf" >> /etc/zabbix_agentd/zabbix_agentd.conf fi =20 +# By default, only listen on GREEN +(=20 + eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings) + if [ -n "${GREEN_ADDRESS}" ]; then + sed -i -e "s|ListenIP=3DGREEN_ADDRESS|ListenIP=3D${GREEN_ADDRESS}|g" /etc/= zabbix_agentd/zabbix_agentd.conf + else + sed -i -e "\|ListenIP=3DGREEN_ADDRESS|d" /etc/zabbix_agentd/zabbix_agentd.= conf + fi +) || : + start_service --background ${NAME} --=20 2.34.1 --=20 Dit bericht is gescanned op virussen en andere gevaarlijke inhoud door MailScanner en lijkt schoon te zijn. --===============7817894201519525004==--