From dc68afcb87839e47f9b42f7692ff1183f37b3e1a Mon Sep 17 00:00:00 2001 From: Muhammad Ibrahim Date: Thu, 2 Oct 2025 13:39:28 +0100 Subject: [PATCH] fix: Prevent set -e exit on agent install failure and show output --- agents/proxmox_auto_enroll.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/agents/proxmox_auto_enroll.sh b/agents/proxmox_auto_enroll.sh index 150518b..6bb8962 100755 --- a/agents/proxmox_auto_enroll.sh +++ b/agents/proxmox_auto_enroll.sh @@ -4,7 +4,7 @@ set -euo pipefail # Exit on error, undefined vars, pipe failures # Trap to catch any unexpected exits trap 'echo "[ERROR] Script exited unexpectedly at line $LINENO with exit code $?"' ERR EXIT -SCRIPT_VERSION="1.0.0-debug.7" +SCRIPT_VERSION="1.0.0-debug.8" echo "[DEBUG] Script Version: $SCRIPT_VERSION ($(date +%Y-%m-%d\ %H:%M:%S))" # ============================================================================= @@ -206,20 +206,21 @@ while IFS= read -r line; do '$PATCHMON_URL/api/v1/hosts/install' && \ bash patchmon-install.sh && \ rm -f patchmon-install.sh - " 2>&1 &1 180s) in $friendly_name" - debug " Install output: $install_output" + info " Install output: $install_output" ((failed_count++)) else warn " ✗ Failed to install agent in $friendly_name (exit: $install_exit_code)" - debug " Install output: $install_output" + info " Install output: $install_output" ((failed_count++)) fi