diff --git a/agents/proxmox_auto_enroll.sh b/agents/proxmox_auto_enroll.sh index 2d6b739..150518b 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.6" +SCRIPT_VERSION="1.0.0-debug.7" echo "[DEBUG] Script Version: $SCRIPT_VERSION ($(date +%Y-%m-%d\ %H:%M:%S))" # ============================================================================= @@ -194,16 +194,31 @@ while IFS= read -r line; do # Install PatchMon agent in container info " Installing PatchMon agent..." - install_output=$(timeout 120 pct exec "$vmid" -- bash -c "curl $CURL_FLAGS \ - -H 'X-API-ID: $api_id' \ - -H 'X-API-KEY: $api_key' \ - '$PATCHMON_URL/api/v1/hosts/install' | bash" 2>&1 &1 180s) in $friendly_name" + debug " Install output: $install_output" + ((failed_count++)) else - error " ✗ Failed to install agent in $friendly_name" + warn " ✗ Failed to install agent in $friendly_name (exit: $install_exit_code)" debug " Install output: $install_output" ((failed_count++)) fi