Skip to content

Commit

Permalink
Merge pull request #70 from wazuh/maintenance/69-merge-#3110-wazuh-pa…
Browse files Browse the repository at this point in the history
…ckages

Bumped "Offline Installation Assistant import the downloaded GPG Wazuh key."
  • Loading branch information
davidcr01 authored Sep 23, 2024
2 parents a58d971 + f5434a1 commit dcca470
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions 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
21 changes: 21 additions & 0 deletions install_functions/wazuh-offline-installation.sh
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 dcca470

Please sign in to comment.