forked from wazuh/wazuh-docker
Merge pull request #392 from wazuh/feature-pr-261
Implement PR 261 on rework branch
This commit is contained in:
@@ -119,12 +119,15 @@ mount_files() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# Stop OSSEC
|
# Allow users to set the container hostname as <node_name> dynamically on
|
||||||
|
# container start.
|
||||||
|
#
|
||||||
|
# To use this:
|
||||||
|
# 1. Create your own ossec.conf file
|
||||||
|
# 2. In your ossec.conf file, set to_be_replaced_by_hostname as your node_name
|
||||||
|
# 3. Mount your custom ossec.conf file at $WAZUH_CONFIG_MOUNT/etc/ossec.conf
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
sed -i 's/<node_name>to_be_replaced_by_hostname<\/node_name>/<node_name>'"${HOSTNAME}"'<\/node_name>/g' ${WAZUH_INSTALL_PATH}/etc/ossec.conf
|
||||||
function ossec_shutdown(){
|
|
||||||
${WAZUH_INSTALL_PATH}/bin/ossec-control stop;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
@@ -153,9 +156,6 @@ main() {
|
|||||||
# Mount selected files (WAZUH_CONFIG_MOUNT) to container
|
# Mount selected files (WAZUH_CONFIG_MOUNT) to container
|
||||||
mount_files
|
mount_files
|
||||||
|
|
||||||
# Trap exit signals and do a proper shutdown
|
|
||||||
trap "ossec_shutdown; exit" SIGINT SIGTERM
|
|
||||||
|
|
||||||
# Delete temporary data folder
|
# Delete temporary data folder
|
||||||
rm -rf ${WAZUH_INSTALL_PATH}/data_tmp
|
rm -rf ${WAZUH_INSTALL_PATH}/data_tmp
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user