From d89aff602d3ebc889e8925361423faf2bb241351 Mon Sep 17 00:00:00 2001 From: Steven Foerster Date: Mon, 19 Apr 2021 21:15:26 -0400 Subject: [PATCH] start and stop agent --- scripts/services/Mistborn-wazuh.service | 3 +++ scripts/services/wazuh/agent_start.sh | 3 +++ scripts/services/wazuh/agent_stop.sh | 3 +++ 3 files changed, 9 insertions(+) create mode 100755 scripts/services/wazuh/agent_start.sh create mode 100755 scripts/services/wazuh/agent_stop.sh diff --git a/scripts/services/Mistborn-wazuh.service b/scripts/services/Mistborn-wazuh.service index 7aaaea7..f91ae95 100644 --- a/scripts/services/Mistborn-wazuh.service +++ b/scripts/services/Mistborn-wazuh.service @@ -16,8 +16,11 @@ ExecStartPre=/opt/mistborn/scripts/wrappers/mistborn_docker.sh wazuh docker-comp ExecStart=/opt/mistborn/scripts/wrappers/mistborn_docker.sh wazuh docker-compose -f /opt/mistborn/extra/wazuh.yml up --build # Agent install ExecStartPost=/opt/mistborn/scripts/wrappers/mistborn_docker.sh wazuh /opt/mistborn/scripts/services/wazuh/agent.sh +ExecStartPost=-/opt/mistborn/scripts/wrappers/mistborn_docker.sh wazuh /opt/mistborn/scripts/services/wazuh/agent_start.sh # Stop container when unit is stopped +ExecStopPre=-/opt/mistborn/scripts/wrappers/mistborn_docker.sh wazuh /opt/mistborn/scripts/services/wazuh/agent_stop.sh ExecStop=/opt/mistborn/scripts/wrappers/mistborn_docker.sh wazuh docker-compose -f /opt/mistborn/extra/wazuh.yml down + [Install] WantedBy=multi-user.target diff --git a/scripts/services/wazuh/agent_start.sh b/scripts/services/wazuh/agent_start.sh new file mode 100755 index 0000000..e243813 --- /dev/null +++ b/scripts/services/wazuh/agent_start.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +systemctl stop wazuh-agent diff --git a/scripts/services/wazuh/agent_stop.sh b/scripts/services/wazuh/agent_stop.sh new file mode 100755 index 0000000..2c98f40 --- /dev/null +++ b/scripts/services/wazuh/agent_stop.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +systemctl start wazuh-agent