Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offline Installation Assistant import the downloaded GPG Wazuh key. #3111

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

}