From fab2546e1adb3f47dda9d8b63a2a00aa4c2117ec Mon Sep 17 00:00:00 2001 From: sinav Date: Sun, 23 Jun 2024 18:54:07 +0300 Subject: [PATCH] wip --- zabbix-agent2/Dockerfile | 3 ++- zabbix-agent2/run.sh | 18 ++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/zabbix-agent2/Dockerfile b/zabbix-agent2/Dockerfile index f6b4a67..774ecd3 100644 --- a/zabbix-agent2/Dockerfile +++ b/zabbix-agent2/Dockerfile @@ -4,7 +4,8 @@ ARG BUILD_BASE_IMAGE=zabbix/zabbix-build-mysql:alpine-${ZBX_VERSION} FROM ${BUILD_BASE_IMAGE} AS builder -FROM alpine:3.19 +# FROM alpine:3.19 +FROM ghcr.io/hassio-addons/debian-base/amd64 ARG MAJOR_VERSION ARG ZBX_VERSION diff --git a/zabbix-agent2/run.sh b/zabbix-agent2/run.sh index e494b40..7ee5994 100644 --- a/zabbix-agent2/run.sh +++ b/zabbix-agent2/run.sh @@ -1,14 +1,12 @@ #!/usr/bin/with-contenv bashio -echo "Hello" +readonly ZBX_CFG_FILE='/config/zabbix_agent2.conf' +bashio::log.info 'Starting zabbix-agent2...' -# readonly ZBX_CFG_FILE='/config/zabbix_agent2.conf' -# bashio::log.info 'Starting zabbix-agent2...' +if ! bashio::fs.file_exists "${ZBX_CFG_FILE}" || [ -z "$(ls -A ${ZBX_CFG_FILE})" ]; then + bashio::log.info "No config ${ZBX_CFG_FILE} exists, copying default." + cp /etc/zabbix/zabbix_agent2.conf ${ZBX_CFG_FILE} +fi -# if ! bashio::fs.file_exists "${ZBX_CFG_FILE}" || [ -z "$(ls -A ${ZBX_CFG_FILE})" ]; then -# bashio::log.info "No config ${ZBX_CFG_FILE} exists, copying default." -# cp /etc/zabbix/zabbix_agent2.conf ${ZBX_CFG_FILE} -# fi - -# # Run zabbix-agent2 in foreground -# zabbix_agent2 --foreground -c /config/zabbix_agent2.conf +# Run zabbix-agent2 in foreground +zabbix_agent2 --foreground -c /config/zabbix_agent2.conf