Skip to content

Commit

Permalink
Merge pull request #2401 from wazuh/2363-fix-debug-redirection-in-ins…
Browse files Browse the repository at this point in the history
…tallation-assistant

Fixed debug redirection in Installation Assistant
  • Loading branch information
teddytpc1 authored Sep 1, 2023
2 parents 55cfe35 + 57f6d3f commit c441c75
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions unattended_installer/install_functions/filebeat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function filebeat_configure(){
fi

eval "chmod go+r /etc/filebeat/wazuh-template.json ${debug}"
eval "common_curl -sS ${filebeat_wazuh_module} --max-time 300 --retry 5 --retry-delay 5 --fail | tar -xvz -C /usr/share/filebeat/module ${debug}"
eval "(common_curl -sS ${filebeat_wazuh_module} --max-time 300 --retry 5 --retry-delay 5 --fail | tar -xvz -C /usr/share/filebeat/module)" "${debug}"
if [ ! -d "/usr/share/filebeat/module" ]; then
common_logger -e "Error downloading wazuh filebeat module."
installCommon_rollBack
Expand All @@ -42,8 +42,8 @@ function filebeat_configure(){
filebeat_copyCertificates

eval "filebeat keystore create ${debug}"
eval "echo admin | filebeat keystore add username --force --stdin ${debug}"
eval "echo admin | filebeat keystore add password --force --stdin ${debug}"
eval "(echo admin | filebeat keystore add username --force --stdin)" "${debug}"
eval "(echo admin | filebeat keystore add password --force --stdin)" "${debug}"

common_logger "Filebeat post-install configuration finished."
}
Expand Down
2 changes: 1 addition & 1 deletion unattended_installer/install_functions/indexer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ function indexer_startCluster() {
else
common_logger "Wazuh indexer cluster security configuration initialized."
fi
eval "common_curl --silent ${filebeat_wazuh_template} --max-time 300 --retry 5 --retry-delay 5" | eval "common_curl -X PUT 'https://${indexer_node_ips[pos]}:9200/_template/wazuh' -H 'Content-Type: application/json' -d @- -uadmin:admin -k --silent --max-time 300 --retry 5 --retry-delay 5 ${debug}"
eval "common_curl --silent ${filebeat_wazuh_template} --max-time 300 --retry 5 --retry-delay 5 ${debug}" | eval "common_curl -X PUT 'https://${indexer_node_ips[pos]}:9200/_template/wazuh' -H 'Content-Type: application/json' -d @- -uadmin:admin -k --silent --max-time 300 --retry 5 --retry-delay 5 ${debug}"
if [ "${PIPESTATUS[0]}" != 0 ]; then
common_logger -e "The wazuh-alerts template could not be inserted into the Wazuh indexer cluster."
exit 1
Expand Down
4 changes: 2 additions & 2 deletions unattended_installer/install_functions/installCommon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function installCommon_addWazuhRepo() {
common_logger -e "Cannot import Wazuh GPG key"
exit 1
fi
eval "echo -e '[wazuh]\ngpgcheck=1\ngpgkey=${repogpg}\nenabled=1\nname=EL-\${releasever} - Wazuh\nbaseurl='${repobaseurl}'/yum/\nprotect=1' | tee /etc/yum.repos.d/wazuh.repo ${debug}"
eval "(echo -e '[wazuh]\ngpgcheck=1\ngpgkey=${repogpg}\nenabled=1\nname=EL-\${releasever} - Wazuh\nbaseurl='${repobaseurl}'/yum/\nprotect=1' | tee /etc/yum.repos.d/wazuh.repo)" "${debug}"
eval "chmod 644 /etc/yum.repos.d/wazuh.repo ${debug}"
elif [ "${sys_type}" == "apt-get" ]; then
eval "common_curl -s ${repogpg} --max-time 300 --retry 5 --retry-delay 5 --fail | gpg --no-default-keyring --keyring gnupg-ring:/usr/share/keyrings/wazuh.gpg --import - ${debug}"
Expand All @@ -56,7 +56,7 @@ function installCommon_addWazuhRepo() {
exit 1
fi
eval "chmod 644 /usr/share/keyrings/wazuh.gpg ${debug}"
eval "echo \"deb [signed-by=/usr/share/keyrings/wazuh.gpg] ${repobaseurl}/apt/ ${reporelease} main\" | tee /etc/apt/sources.list.d/wazuh.list ${debug}"
eval "(echo \"deb [signed-by=/usr/share/keyrings/wazuh.gpg] ${repobaseurl}/apt/ ${reporelease} main\" | tee /etc/apt/sources.list.d/wazuh.list)" "${debug}"
eval "apt-get update -q ${debug}"
eval "chmod 644 /etc/apt/sources.list.d/wazuh.list ${debug}"
fi
Expand Down
2 changes: 1 addition & 1 deletion unattended_installer/passwords_tool/passwordsFunctions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function passwords_changePassword() {
if [ "${nuser}" == "admin" ] || [ -n "${changeall}" ]; then
if [ -n "${filebeat_installed}" ]; then
if filebeat keystore list | grep -q password ; then
eval "echo ${adminpass} | filebeat keystore add password --force --stdin ${debug}"
eval "(echo ${adminpass} | filebeat keystore add password --force --stdin)" "${debug}"
else
wazuhold=$(grep "password:" /etc/filebeat/filebeat.yml )
ra=" password: "
Expand Down

0 comments on commit c441c75

Please sign in to comment.