From d116c970f4cdb754aefd9c2babe6f394a4e1c716 Mon Sep 17 00:00:00 2001 From: f-galland Date: Mon, 16 Sep 2024 16:42:51 -0300 Subject: [PATCH] Fix errors and add .new prefix to /etc/init.d/wazuh-indexer --- distribution/packages/src/deb/debian/postinst | 3 ++- distribution/packages/src/deb/debmake_install.sh | 7 +++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/distribution/packages/src/deb/debian/postinst b/distribution/packages/src/deb/debian/postinst index 883c77d71eb55..ee97e024da055 100644 --- a/distribution/packages/src/deb/debian/postinst +++ b/distribution/packages/src/deb/debian/postinst @@ -24,7 +24,8 @@ tmp_dir=/var/log/wazuh-indexer/tmp # Create needed directories mkdir -p ${tmp_dir} -# Create config files if not already present +# Create config files only if not already present +cp -n /etc/init.d/wazuh-indexer.new /etc/init.d/wazuh-indexer cp -n ${config_dir}/jvm.options.new ${config_dir}/jvm.options cp -n ${config_dir}/opensearch.yml.new ${config_dir}/opensearch.yml cp -n ${config_dir}/opensearch-security/roles.yml.new ${config_dir}/opensearch-security/roles.yml diff --git a/distribution/packages/src/deb/debmake_install.sh b/distribution/packages/src/deb/debmake_install.sh index 5a2789a8e5336..37abaf414604c 100644 --- a/distribution/packages/src/deb/debmake_install.sh +++ b/distribution/packages/src/deb/debmake_install.sh @@ -92,16 +92,15 @@ done # Append ".new" to configuration file names dot_new_config_files=() +dot_new_config_files+=("${buildroot}/etc/init.d/${name}") dot_new_config_files+=("${buildroot}/${config_dir}/jvm.options") dot_new_config_files+=("${buildroot}/${config_dir}/opensearch.yml") dot_new_config_files+=("${buildroot}/${config_dir}/opensearch-security/roles.yml") dot_new_config_files+=("${buildroot}/${config_dir}/opensearch-security/internal_users.yml") -for i in "${dot_new_config_files}" +for i in "${dot_new_config_files[@]}" do - mv "$i" "$i".new + mv "$i" "$i.new" done - - exit 0