From 592f0d1f53fa17c7566c1f663d51a1c63fcab9bb Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Mon, 2 Mar 2026 10:16:58 +0100 Subject: [PATCH] Use exit 105 for unsupported PVE versions Standardize error handling by replacing generic exit 1 with exit 105 in pve_check() across multiple VM template scripts to indicate unsupported Proxmox VE versions. Also add API exit code 226 message for "Proxmox: VM disk import or post-creation setup failed" in misc/api.func. Affected files include misc/api.func and various vm/*-vm.sh scripts. --- misc/api.func | 1 + vm/archlinux-vm.sh | 6 +++--- vm/debian-13-vm.sh | 6 +++--- vm/debian-vm.sh | 6 +++--- vm/haos-vm.sh | 6 +++--- vm/mikrotik-routeros.sh | 6 +++--- vm/nextcloud-vm.sh | 6 +++--- vm/openwrt-vm.sh | 6 +++--- vm/opnsense-vm.sh | 6 +++--- vm/owncloud-vm.sh | 6 +++--- vm/pimox-haos-vm.sh | 6 +++--- vm/truenas-vm.sh | 6 +++--- vm/ubuntu2204-vm.sh | 6 +++--- vm/ubuntu2404-vm.sh | 6 +++--- vm/ubuntu2504-vm.sh | 6 +++--- vm/umbrel-os-vm.sh | 6 +++--- 16 files changed, 46 insertions(+), 45 deletions(-) diff --git a/misc/api.func b/misc/api.func index 9e1a50702..5dbf47050 100644 --- a/misc/api.func +++ b/misc/api.func @@ -301,6 +301,7 @@ explain_exit_code() { 223) echo "Proxmox: Template not available after download" ;; 224) echo "Proxmox: PBS storage is for backups only" ;; 225) echo "Proxmox: No template available for OS/Version" ;; + 226) echo "Proxmox: VM disk import or post-creation setup failed" ;; 231) echo "Proxmox: LXC stack upgrade failed" ;; # --- Tools & Addon Scripts (232-238) --- diff --git a/vm/archlinux-vm.sh b/vm/archlinux-vm.sh index f177536ad..84264d857 100644 --- a/vm/archlinux-vm.sh +++ b/vm/archlinux-vm.sh @@ -158,7 +158,7 @@ pve_check() { if ((MINOR < 0 || MINOR > 9)); then msg_error "This version of Proxmox VE is not supported." msg_error "Supported: Proxmox VE version 8.0 – 8.9" - exit 1 + exit 105 fi return 0 fi @@ -169,7 +169,7 @@ pve_check() { if ((MINOR < 0 || MINOR > 1)); then msg_error "This version of Proxmox VE is not supported." msg_error "Supported: Proxmox VE version 9.0 – 9.1" - exit 1 + exit 105 fi return 0 fi @@ -177,7 +177,7 @@ pve_check() { # All other unsupported versions msg_error "This version of Proxmox VE is not supported." msg_error "Supported versions: Proxmox VE 8.0 – 8.x or 9.0 – 9.1" - exit 1 + exit 105 } function arch_check() { diff --git a/vm/debian-13-vm.sh b/vm/debian-13-vm.sh index 6c69aa555..18cb1a681 100644 --- a/vm/debian-13-vm.sh +++ b/vm/debian-13-vm.sh @@ -158,7 +158,7 @@ pve_check() { if ((MINOR < 0 || MINOR > 9)); then msg_error "This version of Proxmox VE is not supported." msg_error "Supported: Proxmox VE version 8.0 – 8.9" - exit 1 + exit 105 fi return 0 fi @@ -169,7 +169,7 @@ pve_check() { if ((MINOR < 0 || MINOR > 1)); then msg_error "This version of Proxmox VE is not supported." msg_error "Supported: Proxmox VE version 9.0 – 9.1" - exit 1 + exit 105 fi return 0 fi @@ -177,7 +177,7 @@ pve_check() { # All other unsupported versions msg_error "This version of Proxmox VE is not supported." msg_error "Supported versions: Proxmox VE 8.0 – 8.x or 9.0 – 9.1" - exit 1 + exit 105 } function arch_check() { diff --git a/vm/debian-vm.sh b/vm/debian-vm.sh index a916cdb7c..063057a78 100644 --- a/vm/debian-vm.sh +++ b/vm/debian-vm.sh @@ -158,7 +158,7 @@ pve_check() { if ((MINOR < 0 || MINOR > 9)); then msg_error "This version of Proxmox VE is not supported." msg_error "Supported: Proxmox VE version 8.0 – 8.9" - exit 1 + exit 105 fi return 0 fi @@ -169,7 +169,7 @@ pve_check() { if ((MINOR < 0 || MINOR > 1)); then msg_error "This version of Proxmox VE is not supported." msg_error "Supported: Proxmox VE version 9.0 – 9.1" - exit 1 + exit 105 fi return 0 fi @@ -177,7 +177,7 @@ pve_check() { # All other unsupported versions msg_error "This version of Proxmox VE is not supported." msg_error "Supported versions: Proxmox VE 8.0 – 8.x or 9.0 – 9.1" - exit 1 + exit 105 } function arch_check() { diff --git a/vm/haos-vm.sh b/vm/haos-vm.sh index 624458164..3edd59494 100644 --- a/vm/haos-vm.sh +++ b/vm/haos-vm.sh @@ -163,7 +163,7 @@ pve_check() { if ((MINOR < 0 || MINOR > 9)); then msg_error "This version of Proxmox VE is not supported." msg_error "Supported: Proxmox VE version 8.0 – 8.9" - exit 1 + exit 105 fi return 0 fi @@ -174,7 +174,7 @@ pve_check() { if ((MINOR < 0 || MINOR > 1)); then msg_error "This version of Proxmox VE is not supported." msg_error "Supported: Proxmox VE version 9.0 – 9.1" - exit 1 + exit 105 fi return 0 fi @@ -182,7 +182,7 @@ pve_check() { # All other unsupported versions msg_error "This version of Proxmox VE is not supported." msg_error "Supported versions: Proxmox VE 8.0 – 8.x or 9.0 – 9.1" - exit 1 + exit 105 } function arch_check() { diff --git a/vm/mikrotik-routeros.sh b/vm/mikrotik-routeros.sh index c66ec5011..eb0532d6a 100644 --- a/vm/mikrotik-routeros.sh +++ b/vm/mikrotik-routeros.sh @@ -159,7 +159,7 @@ pve_check() { if ((MINOR < 0 || MINOR > 9)); then msg_error "This version of Proxmox VE is not supported." msg_error "Supported: Proxmox VE version 8.0 – 8.9" - exit 1 + exit 105 fi return 0 fi @@ -170,7 +170,7 @@ pve_check() { if ((MINOR < 0 || MINOR > 1)); then msg_error "This version of Proxmox VE is not supported." msg_error "Supported: Proxmox VE version 9.0 – 9.1" - exit 1 + exit 105 fi return 0 fi @@ -178,7 +178,7 @@ pve_check() { # All other unsupported versions msg_error "This version of Proxmox VE is not supported." msg_error "Supported versions: Proxmox VE 8.0 – 8.x or 9.0 – 9.1" - exit 1 + exit 105 } function arch_check() { diff --git a/vm/nextcloud-vm.sh b/vm/nextcloud-vm.sh index 32f2e90e3..c17b299be 100644 --- a/vm/nextcloud-vm.sh +++ b/vm/nextcloud-vm.sh @@ -158,7 +158,7 @@ pve_check() { if ((MINOR < 0 || MINOR > 9)); then msg_error "This version of Proxmox VE is not supported." msg_error "Supported: Proxmox VE version 8.0 – 8.9" - exit 1 + exit 105 fi return 0 fi @@ -169,7 +169,7 @@ pve_check() { if ((MINOR < 0 || MINOR > 1)); then msg_error "This version of Proxmox VE is not supported." msg_error "Supported: Proxmox VE version 9.0 – 9.1" - exit 1 + exit 105 fi return 0 fi @@ -177,7 +177,7 @@ pve_check() { # All other unsupported versions msg_error "This version of Proxmox VE is not supported." msg_error "Supported versions: Proxmox VE 8.0 – 8.x or 9.0 – 9.1" - exit 1 + exit 105 } function arch_check() { diff --git a/vm/openwrt-vm.sh b/vm/openwrt-vm.sh index 751635b2b..01ee4a51e 100644 --- a/vm/openwrt-vm.sh +++ b/vm/openwrt-vm.sh @@ -226,7 +226,7 @@ pve_check() { if ((MINOR < 0 || MINOR > 9)); then msg_error "This version of Proxmox VE is not supported." msg_error "Supported: Proxmox VE version 8.0 – 8.9" - exit 1 + exit 105 fi return 0 fi @@ -237,7 +237,7 @@ pve_check() { if ((MINOR < 0 || MINOR > 1)); then msg_error "This version of Proxmox VE is not supported." msg_error "Supported: Proxmox VE version 9.0 – 9.1" - exit 1 + exit 105 fi return 0 fi @@ -245,7 +245,7 @@ pve_check() { # All other unsupported versions msg_error "This version of Proxmox VE is not supported." msg_error "Supported versions: Proxmox VE 8.0 – 8.x or 9.0 – 9.1" - exit 1 + exit 105 } function arch_check() { diff --git a/vm/opnsense-vm.sh b/vm/opnsense-vm.sh index 77489b9b5..4048483a0 100644 --- a/vm/opnsense-vm.sh +++ b/vm/opnsense-vm.sh @@ -210,7 +210,7 @@ pve_check() { if ((MINOR < 0 || MINOR > 9)); then msg_error "This version of Proxmox VE is not supported." msg_error "Supported: Proxmox VE version 8.0 – 8.9" - exit 1 + exit 105 fi return 0 fi @@ -221,7 +221,7 @@ pve_check() { if ((MINOR < 0 || MINOR > 1)); then msg_error "This version of Proxmox VE is not supported." msg_error "Supported: Proxmox VE version 9.0 – 9.1" - exit 1 + exit 105 fi return 0 fi @@ -229,7 +229,7 @@ pve_check() { # All other unsupported versions msg_error "This version of Proxmox VE is not supported." msg_error "Supported versions: Proxmox VE 8.0 – 8.x or 9.0 – 9.1" - exit 1 + exit 105 } function arch_check() { diff --git a/vm/owncloud-vm.sh b/vm/owncloud-vm.sh index fdc3a2dc8..5efe13ca4 100644 --- a/vm/owncloud-vm.sh +++ b/vm/owncloud-vm.sh @@ -159,7 +159,7 @@ pve_check() { if ((MINOR < 0 || MINOR > 9)); then msg_error "This version of Proxmox VE is not supported." msg_error "Supported: Proxmox VE version 8.0 – 8.9" - exit 1 + exit 105 fi return 0 fi @@ -170,7 +170,7 @@ pve_check() { if ((MINOR < 0 || MINOR > 1)); then msg_error "This version of Proxmox VE is not supported." msg_error "Supported: Proxmox VE version 9.0 – 9.1" - exit 1 + exit 105 fi return 0 fi @@ -178,7 +178,7 @@ pve_check() { # All other unsupported versions msg_error "This version of Proxmox VE is not supported." msg_error "Supported versions: Proxmox VE 8.0 – 8.x or 9.0 – 9.1" - exit 1 + exit 105 } function arch_check() { diff --git a/vm/pimox-haos-vm.sh b/vm/pimox-haos-vm.sh index 7f0f5e929..a3bbba24d 100644 --- a/vm/pimox-haos-vm.sh +++ b/vm/pimox-haos-vm.sh @@ -167,7 +167,7 @@ pve_check() { if ((MINOR < 0 || MINOR > 9)); then msg_error "This version of Proxmox VE is not supported." msg_error "Supported: Proxmox VE version 8.0 – 8.9" - exit 1 + exit 105 fi return 0 fi @@ -178,7 +178,7 @@ pve_check() { if ((MINOR < 0 || MINOR > 1)); then msg_error "This version of Proxmox VE is not supported." msg_error "Supported: Proxmox VE version 9.0 – 9.1" - exit 1 + exit 105 fi return 0 fi @@ -186,7 +186,7 @@ pve_check() { # All other unsupported versions msg_error "This version of Proxmox VE is not supported." msg_error "Supported versions: Proxmox VE 8.0 – 8.x or 9.0 – 9.1" - exit 1 + exit 105 } function arch_check() { diff --git a/vm/truenas-vm.sh b/vm/truenas-vm.sh index 40e0a7e47..2e4002893 100644 --- a/vm/truenas-vm.sh +++ b/vm/truenas-vm.sh @@ -192,7 +192,7 @@ function pve_check() { if ((MINOR < 0 || MINOR > 9)); then msg_error "This version of Proxmox VE is not supported." msg_error "Supported: Proxmox VE version 8.0 – 8.9" - exit 1 + exit 105 fi return 0 fi @@ -202,14 +202,14 @@ function pve_check() { if ((MINOR < 0 || MINOR > 1)); then msg_error "This version of Proxmox VE is not yet supported." msg_error "Supported: Proxmox VE version 9.0 – 9.1" - exit 1 + exit 105 fi return 0 fi msg_error "This version of Proxmox VE is not supported." msg_error "Supported versions: Proxmox VE 8.0 – 8.x or 9.0 – 9.1" - exit 1 + exit 105 } function arch_check() { diff --git a/vm/ubuntu2204-vm.sh b/vm/ubuntu2204-vm.sh index 953f6cbbd..b118863ec 100644 --- a/vm/ubuntu2204-vm.sh +++ b/vm/ubuntu2204-vm.sh @@ -155,7 +155,7 @@ pve_check() { if ((MINOR < 0 || MINOR > 9)); then msg_error "This version of Proxmox VE is not supported." msg_error "Supported: Proxmox VE version 8.0 – 8.9" - exit 1 + exit 105 fi return 0 fi @@ -166,7 +166,7 @@ pve_check() { if ((MINOR < 0 || MINOR > 1)); then msg_error "This version of Proxmox VE is not supported." msg_error "Supported: Proxmox VE version 9.0 – 9.1" - exit 1 + exit 105 fi return 0 fi @@ -174,7 +174,7 @@ pve_check() { # All other unsupported versions msg_error "This version of Proxmox VE is not supported." msg_error "Supported versions: Proxmox VE 8.0 – 8.x or 9.0 – 9.1" - exit 1 + exit 105 } function arch_check() { diff --git a/vm/ubuntu2404-vm.sh b/vm/ubuntu2404-vm.sh index 7c5d010c1..25e5c2ea9 100644 --- a/vm/ubuntu2404-vm.sh +++ b/vm/ubuntu2404-vm.sh @@ -158,7 +158,7 @@ pve_check() { if ((MINOR < 0 || MINOR > 9)); then msg_error "This version of Proxmox VE is not supported." msg_error "Supported: Proxmox VE version 8.0 – 8.9" - exit 1 + exit 105 fi return 0 fi @@ -169,7 +169,7 @@ pve_check() { if ((MINOR < 0 || MINOR > 1)); then msg_error "This version of Proxmox VE is not supported." msg_error "Supported: Proxmox VE version 9.0 – 9.1" - exit 1 + exit 105 fi return 0 fi @@ -177,7 +177,7 @@ pve_check() { # All other unsupported versions msg_error "This version of Proxmox VE is not supported." msg_error "Supported versions: Proxmox VE 8.0 – 8.x or 9.0 – 9.1" - exit 1 + exit 105 } function arch_check() { diff --git a/vm/ubuntu2504-vm.sh b/vm/ubuntu2504-vm.sh index 4bbe513ec..7b0176f69 100644 --- a/vm/ubuntu2504-vm.sh +++ b/vm/ubuntu2504-vm.sh @@ -157,7 +157,7 @@ pve_check() { if ((MINOR < 0 || MINOR > 9)); then msg_error "This version of Proxmox VE is not supported." msg_error "Supported: Proxmox VE version 8.0 – 8.9" - exit 1 + exit 105 fi return 0 fi @@ -168,7 +168,7 @@ pve_check() { if ((MINOR < 0 || MINOR > 1)); then msg_error "This version of Proxmox VE is not supported." msg_error "Supported: Proxmox VE version 9.0 – 9.1" - exit 1 + exit 105 fi return 0 fi @@ -176,7 +176,7 @@ pve_check() { # All other unsupported versions msg_error "This version of Proxmox VE is not supported." msg_error "Supported versions: Proxmox VE 8.0 – 8.x or 9.0 – 9.1" - exit 1 + exit 105 } function arch_check() { diff --git a/vm/umbrel-os-vm.sh b/vm/umbrel-os-vm.sh index 01491e41d..b8dca5d96 100644 --- a/vm/umbrel-os-vm.sh +++ b/vm/umbrel-os-vm.sh @@ -157,7 +157,7 @@ pve_check() { if ((MINOR < 0 || MINOR > 9)); then msg_error "This version of Proxmox VE is not supported." msg_error "Supported: Proxmox VE version 8.0 – 8.9" - exit 1 + exit 105 fi return 0 fi @@ -168,7 +168,7 @@ pve_check() { if ((MINOR < 0 || MINOR > 1)); then msg_error "This version of Proxmox VE is not supported." msg_error "Supported: Proxmox VE version 9.0 – 9.1" - exit 1 + exit 105 fi return 0 fi @@ -176,7 +176,7 @@ pve_check() { # All other unsupported versions msg_error "This version of Proxmox VE is not supported." msg_error "Supported versions: Proxmox VE 8.0 – 8.x or 9.0 – 9.1" - exit 1 + exit 105 } function arch_check() {