From 78ae4ca00baf35b437babeb3144e730ceee32b46 Mon Sep 17 00:00:00 2001 From: imbytecat Date: Wed, 4 Sep 2024 13:07:00 +0800 Subject: [PATCH] chore --- .gitea/workflows/template-cleanup.yaml | 6 ++++-- Dockerfile | 2 +- integration/zabbixagent/constant.go | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/template-cleanup.yaml b/.gitea/workflows/template-cleanup.yaml index 2403794..e1555b2 100644 --- a/.gitea/workflows/template-cleanup.yaml +++ b/.gitea/workflows/template-cleanup.yaml @@ -29,9 +29,11 @@ jobs: REPO_NAME="${GITHUB_REPOSITORY##*/}" SAFE_OWNER=$(echo $OWNER | sed 's/[^a-zA-Z0-9]//g' | tr '[:upper:]' '[:lower:]') SAFE_REPO_NAME=$(echo $REPO_NAME | sed 's/[^a-zA-Z0-9]//g' | tr '[:upper:]' '[:lower:]') - - # 替换模板包名 + PLUGIN_NAME=$(echo "$SAFE_REPO_NAME" | sed 's/^\(.\)/\U\1/') + + # 替换包名 find . -type f -exec sed -i "s/zabbixagent2plugintemplate/$SAFE_REPO_NAME/g" {} + + find . -type f -exec sed -i "s/Zabbixagent2plugintemplate/$PLUGIN_NAME/g" {} + find . -type f -exec sed -i "s/Zabbix Agent 2 Plugin Template/$REPO_NAME/g" {} + - name: Commit files diff --git a/Dockerfile b/Dockerfile index c54711b..07a108f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,4 +6,4 @@ RUN CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -o out/app FROM zabbix/zabbix-agent2:ubuntu-7.0-latest COPY --from=builder /build/out/app /usr/sbin/zabbix-agent2-plugin/zabbixagent2plugintemplate -RUN echo "Plugins.zabbixagent2plugintemplate.System.Path=/usr/sbin/zabbix-agent2-plugin/zabbixagent2plugintemplate" >> /etc/zabbix/zabbix_agent2.d/plugins.d/zabbixagent2plugintemplate.conf +RUN echo "Plugins.Zabbixagent2plugintemplate.System.Path=/usr/sbin/zabbix-agent2-plugin/zabbixagent2plugintemplate" >> /etc/zabbix/zabbix_agent2.d/plugins.d/zabbixagent2plugintemplate.conf diff --git a/integration/zabbixagent/constant.go b/integration/zabbixagent/constant.go index 8b6abf4..1d1e152 100644 --- a/integration/zabbixagent/constant.go +++ b/integration/zabbixagent/constant.go @@ -1,5 +1,5 @@ package zabbixagent const ( - PluginName = "ONVIF" + PluginName = "Zabbixagent2plugintemplate" )