From 1bc0f8b3d49eec481eda2c392e43eb8f493e3ea3 Mon Sep 17 00:00:00 2001 From: John Gaunt Date: Sun, 25 Apr 2021 10:58:25 -0400 Subject: [PATCH] updated sed to work with hostname and ip address for server --- zabbix_agent.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zabbix_agent.sh b/zabbix_agent.sh index a91ab00..bdcb497 100644 --- a/zabbix_agent.sh +++ b/zabbix_agent.sh @@ -121,9 +121,9 @@ if [ $(grep -c "^Server=127.0.0.1" /etc/zabbix/zabbix_agentd.conf) -eq 1 ]; then sed --in-place $'s/^# Hostname=/# Hostname=\\\nHostname='${hostname}'/' /etc/zabbix/zabbix_agentd.conf fi # configure the zabbix server - sed --in-place 's/^Server=127.0.0.1/Server='${ZABBIX_SERVER}'/' /etc/zabbix/zabbix_agentd.conf + sed --in-place 's/^Server=127.0.0.1/Server='"${ZABBIX_SERVER}"'/' /etc/zabbix/zabbix_agentd.conf # configure the zabbix server - sed --in-place 's/^ServerActive=127.0.0.1/ServerActive='${ZABBIX_SERVER}'/' /etc/zabbix/zabbix_agentd.conf + sed --in-place 's/^ServerActive=127.0.0.1/ServerActive='"${ZABBIX_SERVER}"'/' /etc/zabbix/zabbix_agentd.conf # configure the encryption sed --in-place $'s/^# TLSAccept=unencrypted/# TLSAccept=unencrypted\\\nTLSAccept=psk/' /etc/zabbix/zabbix_agentd.conf sed --in-place $'s/^# TLSConnect=unencrypted/# TLSConnect=unencrypted\\\nTLSConnect=psk/' /etc/zabbix/zabbix_agentd.conf