Skip to content

Commit

Permalink
fix: Update install script to create a temporary directory
Browse files Browse the repository at this point in the history
The install script has been updated to create a temporary directory using the "mktemp -d" command. This ensures that the directory is created correctly and avoids any potential issues with file operations. Additionally, a success message is now displayed after the Wazuh agent installation is completed.
  • Loading branch information
bengo237 committed Sep 19, 2024
1 parent 9033f1f commit db81f46
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ installation() {
BASE_URL="https://packages.wazuh.com/4.x/macos"
PKG_NAME="wazuh-agent-4.9.0-1.${ARCH}64.pkg"
PKG_URL="$BASE_URL/$PKG_NAME"
TMP_DIR="$(mktemp)"
TMP_DIR="$(mktemp -d)"
mkdir -p "$TMP_DIR"
if [ ! -f "$TMP_DIR/$PKG_NAME" ]; then
curl -o "$TMP_DIR/$PKG_NAME" "$PKG_URL"
Expand Down Expand Up @@ -174,10 +174,11 @@ start_agent() {
info_message "Wazuh agent started successfully."
}


# Main execution
import_keys
installation
# disable_repo
disable_repo
config
start_agent
start_agent
info_message "Wazuh agent installation completed successfully."
# End of script

0 comments on commit db81f46

Please sign in to comment.