keep logs for all 3 attempts

This commit is contained in:
reyesj2
2026-07-09 14:18:08 -05:00
parent 8b0759866e
commit 2959dc9564
@@ -16,8 +16,6 @@ check_agent_health() {
interval=10
start=$SECONDS
truncate -s 0 "$LOGFILE"
while (( SECONDS - start < timeout )); do
agent_status=$(elastic-agent status 2>&1)
echo -e "\n$(date)\n$agent_status\n" >> "$LOGFILE"
@@ -70,6 +68,8 @@ if [[ -x /opt/so/so-elastic-agent_linux_amd64 ]]; then
attempts=0
cd /opt/so/ || exit 1
truncate -s 0 "$LOGFILE"
uninstall_agent
while [[ $attempts -lt 3 ]]; do