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