Skip to content

Commit

Permalink
Merge pull request #3111 from wazuh/bug/3093-wazuh-installation-assis…
Browse files Browse the repository at this point in the history
…tant-does-not-install-the-gpg-key-in-the-offline-instances

Offline Installation Assistant import the downloaded GPG Wazuh key.
  • Loading branch information
c-bordon authored Sep 10, 2024
2 parents 11c56bc + b865967 commit 144747c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions unattended_installer/install_functions/installMain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ function main() {
if [ -n "${offline_install}" ]; then
offline_checkPreinstallation
offline_extractFiles
offline_importGPGKey
fi

if [ -n "${AIO}" ] || [ -n "${indexer}" ] || [ -n "${dashboard}" ] || [ -n "${wazuh}" ]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,24 @@ function offline_extractFiles() {

common_logger -d "Offline files extracted successfully."
}

# Imports the GPG key from the extracted tar file
function offline_importGPGKey() {

common_logger -d "Importing Wazuh GPG key."
if [ "${sys_type}" == "yum" ]; then
eval "rpm --import ${offline_files_path}/GPG-KEY-WAZUH ${debug}"
if [ "${PIPESTATUS[0]}" != 0 ]; then
common_logger -e "Cannot import Wazuh GPG key"
exit 1
fi
elif [ "${sys_type}" == "apt-get" ]; then
eval "gpg --import ${offline_files_path}/GPG-KEY-WAZUH ${debug}"
if [ "${PIPESTATUS[0]}" != 0 ]; then
common_logger -e "Cannot import Wazuh GPG key"
exit 1
fi
eval "chmod 644 ${offline_files_path}/GPG-KEY-WAZUH ${debug}"
fi

}

0 comments on commit 144747c

Please sign in to comment.