-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Expand file tree
/
Copy pathupgrade.sh
More file actions
executable file
·26 lines (23 loc) · 917 Bytes
/
Copy pathupgrade.sh
File metadata and controls
executable file
·26 lines (23 loc) · 917 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
# Copyright (C) 2015, Wazuh Inc.
# Testing-only flag to bypass the manager reachability check (used by WPK
# smoke tests that upgrade without a real manager available).
if [ "$1" = "--skip-manager-check" ]; then
export WAZUH_UPGRADE_TEST_SKIP_MANAGER_CHECK=1
fi
clean_upgrade_dir() {
for file in ./var/upgrade/*; do
[ "$file" = "./var/upgrade/upgrade_result" ] && continue
rm -rf "$file"
done
}
# validate OS, linux or macos
if [ "X$(uname)" = "XLinux" ] ; then
# Get Wazuh installation path
SCRIPT=$(readlink -f "$0")
WAZUH_HOME=$(dirname $(dirname $(dirname "$SCRIPT")))
cd "${WAZUH_HOME}"
(sleep 5 && chmod +x ./var/upgrade/*.sh && ./var/upgrade/pkg_installer.sh && clean_upgrade_dir) >> ./logs/upgrade.log 2>&1 &
else
(sleep 5 && chmod +x ./var/upgrade/*.sh && ./var/upgrade/pkg_installer.sh && clean_upgrade_dir) >> ./logs/upgrade.log 2>&1 &
fi