Skip to content

Commit

Permalink
fix: Update install script to use a temporary directory
Browse files Browse the repository at this point in the history
  • Loading branch information
bengo237 committed Sep 19, 2024
1 parent db81f46 commit 7862555
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,17 +118,17 @@ installation() {
PKG_NAME="wazuh-agent-4.9.0-1.${ARCH}64.pkg"
PKG_URL="$BASE_URL/$PKG_NAME"
TMP_DIR="$(mktemp -d)"
mkdir -p "$TMP_DIR"
if [ ! -f "$TMP_DIR/$PKG_NAME" ]; then
curl -o "$TMP_DIR/$PKG_NAME" "$PKG_URL"
info_message "Wazuh agent downloaded successfully."
fi
info_message "Using temporary directory: $TMP_DIR"
curl -o "$TMP_DIR/$PKG_NAME" "$PKG_URL"
info_message "Wazuh agent downloaded successfully."
echo "WAZUH_MANAGER='$WAZUH_MANAGER'" > /tmp/wazuh_envs
installer -pkg "$TMP_DIR/$PKG_NAME" -target /
rm -rf "$TMP_DIR" # Clean up the temporary directory after installation
fi
info_message "Wazuh agent installed successfully."
}


disable_repo() {
# Disable Wazuh repository after installation for Linux
if [ "$OS" = "Linux" ]; then
Expand Down Expand Up @@ -180,5 +180,5 @@ installation
disable_repo
config
start_agent
info_message "Wazuh agent installation completed successfully."

# End of script

0 comments on commit 7862555

Please sign in to comment.