mirror of
				https://github.com/9technologygroup/patchmon.net.git
				synced 2025-11-03 21:43:33 +00:00 
			
		
		
		
	debug: Add strict error handling and exit trap to diagnose silent exit
This commit is contained in:
		@@ -1,4 +1,8 @@
 | 
				
			|||||||
#!/bin/bash
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					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
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# =============================================================================
 | 
					# =============================================================================
 | 
				
			||||||
# PatchMon Proxmox LXC Auto-Enrollment Script
 | 
					# PatchMon Proxmox LXC Auto-Enrollment Script
 | 
				
			||||||
@@ -101,10 +105,12 @@ total_containers=$(echo "$lxc_list" | wc -l)
 | 
				
			|||||||
info "Found $total_containers LXC container(s)"
 | 
					info "Found $total_containers LXC container(s)"
 | 
				
			||||||
echo ""
 | 
					echo ""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					info "Initializing statistics..."
 | 
				
			||||||
# ===== STATISTICS =====
 | 
					# ===== STATISTICS =====
 | 
				
			||||||
enrolled_count=0
 | 
					enrolled_count=0
 | 
				
			||||||
skipped_count=0
 | 
					skipped_count=0
 | 
				
			||||||
failed_count=0
 | 
					failed_count=0
 | 
				
			||||||
 | 
					info "Statistics initialized"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# ===== PROCESS CONTAINERS =====
 | 
					# ===== PROCESS CONTAINERS =====
 | 
				
			||||||
info "Starting container processing loop..."
 | 
					info "Starting container processing loop..."
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user