From ba70f9867b292bd131cc3edad3ddf64fef5d4726 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 28 Jul 2025 11:00:09 +0200 Subject: [PATCH] ProxmoxVE 9.0 Beta: add BETA Version as test in pve_check (#6295) --- misc/build.func | 35 +++++++++++++++++++++++++++++------ vm/archlinux-vm.sh | 37 ++++++++++++++++++++++++++++++------- vm/debian-vm.sh | 37 ++++++++++++++++++++++++++++++------- vm/docker-vm.sh | 37 ++++++++++++++++++++++++++++++------- vm/haos-vm.sh | 37 ++++++++++++++++++++++++++++++------- vm/mikrotik-routeros.sh | 37 ++++++++++++++++++++++++++++++------- vm/nextcloud-vm.sh | 37 ++++++++++++++++++++++++++++++------- vm/openwrt.sh | 37 ++++++++++++++++++++++++++++++------- vm/opnsense-vm.sh | 37 ++++++++++++++++++++++++++++++------- vm/owncloud-vm.sh | 37 ++++++++++++++++++++++++++++++------- vm/pimox-haos-vm.sh | 37 ++++++++++++++++++++++++++++++------- vm/ubuntu2204-vm.sh | 37 ++++++++++++++++++++++++++++++------- vm/ubuntu2404-vm.sh | 37 ++++++++++++++++++++++++++++++------- vm/ubuntu2410-vm.sh | 37 ++++++++++++++++++++++++++++++------- vm/ubuntu2504-vm.sh | 37 ++++++++++++++++++++++++++++++------- vm/umbrel-os-vm.sh | 37 ++++++++++++++++++++++++++++++------- 16 files changed, 479 insertions(+), 111 deletions(-) diff --git a/misc/build.func b/misc/build.func index 7c6d16155..8a9bcbbc8 100644 --- a/misc/build.func +++ b/misc/build.func @@ -66,13 +66,36 @@ root_check() { # This function checks the version of Proxmox Virtual Environment (PVE) and exits if the version is not supported. pve_check() { - if ! pveversion | grep -Eq "pve-manager/8\.[0-4](\.[0-9]+)*"; then - msg_error "${CROSS}${RD}This version of Proxmox Virtual Environment is not supported" - echo -e "Requires Proxmox Virtual Environment Version 8.1 or later." - echo -e "Exiting..." - sleep 2 - exit + local PVE_VER + PVE_VER="$(pveversion | awk -F'/' '{print $2}' | awk -F'-' '{print $1}')" + + # Check for Proxmox VE 8.x + if [[ "$PVE_VER" =~ ^8\.([0-9]+) ]]; then + local MINOR="${BASH_REMATCH[1]}" + if ((MINOR < 1 || MINOR > 4)); then + msg_error "This version of Proxmox VE is not supported." + echo -e "Required: Proxmox VE version 8.1 – 8.4" + exit 1 + fi + return 0 fi + + # Check for Proxmox VE 9.x (Beta) — require confirmation + if [[ "$PVE_VER" =~ ^9\.([0-9]+) ]]; then + if whiptail --title "Proxmox 9.x Detected (Beta)" \ + --yesno "You are using Proxmox VE $PVE_VER, which is currently in Beta state.\n\nThis version is experimentally supported.\n\nDo you want to proceed anyway?" 12 70; then + msg_ok "Confirmed: Continuing with Proxmox VE $PVE_VER" + return 0 + else + msg_error "Aborted by user: Proxmox VE 9.x was not confirmed." + exit 1 + fi + fi + + # All other unsupported versions + msg_error "This version of Proxmox VE is not supported." + echo -e "Supported versions: Proxmox VE 8.1 – 8.4 or 9.x (Beta, with confirmation)" + exit 1 } # When a node is running tens of containers, it's possible to exceed the kernel's cryptographic key storage allocations. diff --git a/vm/archlinux-vm.sh b/vm/archlinux-vm.sh index 30f61e960..2eae37e82 100644 --- a/vm/archlinux-vm.sh +++ b/vm/archlinux-vm.sh @@ -138,14 +138,37 @@ function check_root() { fi } -function pve_check() { - if ! pveversion | grep -Eq "pve-manager/8\.[1-4](\.[0-9]+)*"; then - msg_error "${CROSS}${RD}This version of Proxmox Virtual Environment is not supported" - echo -e "Requires Proxmox Virtual Environment Version 8.1 or later." - echo -e "Exiting..." - sleep 2 - exit +pve_check() { + local PVE_VER + PVE_VER="$(pveversion | awk -F'/' '{print $2}' | awk -F'-' '{print $1}')" + + # Check for Proxmox VE 8.x + if [[ "$PVE_VER" =~ ^8\.([0-9]+) ]]; then + local MINOR="${BASH_REMATCH[1]}" + if ((MINOR < 1 || MINOR > 4)); then + msg_error "This version of Proxmox VE is not supported." + echo -e "Required: Proxmox VE version 8.1 – 8.4" + exit 1 + fi + return 0 fi + + # Check for Proxmox VE 9.x (Beta) — require confirmation + if [[ "$PVE_VER" =~ ^9\.([0-9]+) ]]; then + if whiptail --title "Proxmox 9.x Detected (Beta)" \ + --yesno "You are using Proxmox VE $PVE_VER, which is currently in Beta state.\n\nThis version is experimentally supported.\n\nDo you want to proceed anyway?" 12 70; then + msg_ok "Confirmed: Continuing with Proxmox VE $PVE_VER" + return 0 + else + msg_error "Aborted by user: Proxmox VE 9.x was not confirmed." + exit 1 + fi + fi + + # All other unsupported versions + msg_error "This version of Proxmox VE is not supported." + echo -e "Supported versions: Proxmox VE 8.1 – 8.4 or 9.x (Beta, with confirmation)" + exit 1 } function arch_check() { diff --git a/vm/debian-vm.sh b/vm/debian-vm.sh index 746a534e8..0642800d8 100644 --- a/vm/debian-vm.sh +++ b/vm/debian-vm.sh @@ -138,14 +138,37 @@ function check_root() { fi } -function pve_check() { - if ! pveversion | grep -Eq "pve-manager/8\.[1-4](\.[0-9]+)*"; then - msg_error "${CROSS}${RD}This version of Proxmox Virtual Environment is not supported" - echo -e "Requires Proxmox Virtual Environment Version 8.1 or later." - echo -e "Exiting..." - sleep 2 - exit +pve_check() { + local PVE_VER + PVE_VER="$(pveversion | awk -F'/' '{print $2}' | awk -F'-' '{print $1}')" + + # Check for Proxmox VE 8.x + if [[ "$PVE_VER" =~ ^8\.([0-9]+) ]]; then + local MINOR="${BASH_REMATCH[1]}" + if ((MINOR < 1 || MINOR > 4)); then + msg_error "This version of Proxmox VE is not supported." + echo -e "Required: Proxmox VE version 8.1 – 8.4" + exit 1 + fi + return 0 fi + + # Check for Proxmox VE 9.x (Beta) — require confirmation + if [[ "$PVE_VER" =~ ^9\.([0-9]+) ]]; then + if whiptail --title "Proxmox 9.x Detected (Beta)" \ + --yesno "You are using Proxmox VE $PVE_VER, which is currently in Beta state.\n\nThis version is experimentally supported.\n\nDo you want to proceed anyway?" 12 70; then + msg_ok "Confirmed: Continuing with Proxmox VE $PVE_VER" + return 0 + else + msg_error "Aborted by user: Proxmox VE 9.x was not confirmed." + exit 1 + fi + fi + + # All other unsupported versions + msg_error "This version of Proxmox VE is not supported." + echo -e "Supported versions: Proxmox VE 8.1 – 8.4 or 9.x (Beta, with confirmation)" + exit 1 } function arch_check() { diff --git a/vm/docker-vm.sh b/vm/docker-vm.sh index bf5e802fe..c7f1fe300 100644 --- a/vm/docker-vm.sh +++ b/vm/docker-vm.sh @@ -139,14 +139,37 @@ function check_root() { fi } -function pve_check() { - if ! pveversion | grep -Eq "pve-manager/8\.[1-4](\.[0-9]+)*"; then - msg_error "${CROSS}${RD}This version of Proxmox Virtual Environment is not supported" - echo -e "Requires Proxmox Virtual Environment Version 8.1 or later." - echo -e "Exiting..." - sleep 2 - exit +pve_check() { + local PVE_VER + PVE_VER="$(pveversion | awk -F'/' '{print $2}' | awk -F'-' '{print $1}')" + + # Check for Proxmox VE 8.x + if [[ "$PVE_VER" =~ ^8\.([0-9]+) ]]; then + local MINOR="${BASH_REMATCH[1]}" + if ((MINOR < 1 || MINOR > 4)); then + msg_error "This version of Proxmox VE is not supported." + echo -e "Required: Proxmox VE version 8.1 – 8.4" + exit 1 + fi + return 0 fi + + # Check for Proxmox VE 9.x (Beta) — require confirmation + if [[ "$PVE_VER" =~ ^9\.([0-9]+) ]]; then + if whiptail --title "Proxmox 9.x Detected (Beta)" \ + --yesno "You are using Proxmox VE $PVE_VER, which is currently in Beta state.\n\nThis version is experimentally supported.\n\nDo you want to proceed anyway?" 12 70; then + msg_ok "Confirmed: Continuing with Proxmox VE $PVE_VER" + return 0 + else + msg_error "Aborted by user: Proxmox VE 9.x was not confirmed." + exit 1 + fi + fi + + # All other unsupported versions + msg_error "This version of Proxmox VE is not supported." + echo -e "Supported versions: Proxmox VE 8.1 – 8.4 or 9.x (Beta, with confirmation)" + exit 1 } function arch_check() { diff --git a/vm/haos-vm.sh b/vm/haos-vm.sh index 902ce984b..26b823056 100644 --- a/vm/haos-vm.sh +++ b/vm/haos-vm.sh @@ -142,14 +142,37 @@ function check_root() { fi } -function pve_check() { - if ! pveversion | grep -Eq "pve-manager/8\.[1-4](\.[0-9]+)*"; then - msg_error "${CROSS}${RD}This version of Proxmox Virtual Environment is not supported" - echo -e "Requires Proxmox Virtual Environment Version 8.1 or later." - echo -e "Exiting..." - sleep 2 - exit +pve_check() { + local PVE_VER + PVE_VER="$(pveversion | awk -F'/' '{print $2}' | awk -F'-' '{print $1}')" + + # Check for Proxmox VE 8.x + if [[ "$PVE_VER" =~ ^8\.([0-9]+) ]]; then + local MINOR="${BASH_REMATCH[1]}" + if ((MINOR < 1 || MINOR > 4)); then + msg_error "This version of Proxmox VE is not supported." + echo -e "Required: Proxmox VE version 8.1 – 8.4" + exit 1 + fi + return 0 fi + + # Check for Proxmox VE 9.x (Beta) — require confirmation + if [[ "$PVE_VER" =~ ^9\.([0-9]+) ]]; then + if whiptail --title "Proxmox 9.x Detected (Beta)" \ + --yesno "You are using Proxmox VE $PVE_VER, which is currently in Beta state.\n\nThis version is experimentally supported.\n\nDo you want to proceed anyway?" 12 70; then + msg_ok "Confirmed: Continuing with Proxmox VE $PVE_VER" + return 0 + else + msg_error "Aborted by user: Proxmox VE 9.x was not confirmed." + exit 1 + fi + fi + + # All other unsupported versions + msg_error "This version of Proxmox VE is not supported." + echo -e "Supported versions: Proxmox VE 8.1 – 8.4 or 9.x (Beta, with confirmation)" + exit 1 } function arch_check() { diff --git a/vm/mikrotik-routeros.sh b/vm/mikrotik-routeros.sh index 3a4f91d0a..21b5a3007 100644 --- a/vm/mikrotik-routeros.sh +++ b/vm/mikrotik-routeros.sh @@ -139,14 +139,37 @@ function check_root() { fi } -function pve_check() { - if ! pveversion | grep -Eq "pve-manager/8\.[1-4](\.[0-9]+)*"; then - msg_error "${CROSS}${RD}This version of Proxmox Virtual Environment is not supported" - echo -e "Requires Proxmox Virtual Environment Version 8.1 or later." - echo -e "Exiting..." - sleep 2 - exit +pve_check() { + local PVE_VER + PVE_VER="$(pveversion | awk -F'/' '{print $2}' | awk -F'-' '{print $1}')" + + # Check for Proxmox VE 8.x + if [[ "$PVE_VER" =~ ^8\.([0-9]+) ]]; then + local MINOR="${BASH_REMATCH[1]}" + if ((MINOR < 1 || MINOR > 4)); then + msg_error "This version of Proxmox VE is not supported." + echo -e "Required: Proxmox VE version 8.1 – 8.4" + exit 1 + fi + return 0 fi + + # Check for Proxmox VE 9.x (Beta) — require confirmation + if [[ "$PVE_VER" =~ ^9\.([0-9]+) ]]; then + if whiptail --title "Proxmox 9.x Detected (Beta)" \ + --yesno "You are using Proxmox VE $PVE_VER, which is currently in Beta state.\n\nThis version is experimentally supported.\n\nDo you want to proceed anyway?" 12 70; then + msg_ok "Confirmed: Continuing with Proxmox VE $PVE_VER" + return 0 + else + msg_error "Aborted by user: Proxmox VE 9.x was not confirmed." + exit 1 + fi + fi + + # All other unsupported versions + msg_error "This version of Proxmox VE is not supported." + echo -e "Supported versions: Proxmox VE 8.1 – 8.4 or 9.x (Beta, with confirmation)" + exit 1 } function arch_check() { diff --git a/vm/nextcloud-vm.sh b/vm/nextcloud-vm.sh index 8d6c0fe3b..62ad1ea56 100644 --- a/vm/nextcloud-vm.sh +++ b/vm/nextcloud-vm.sh @@ -138,14 +138,37 @@ function check_root() { fi } -function pve_check() { - if ! pveversion | grep -Eq "pve-manager/8\.[1-4](\.[0-9]+)*"; then - msg_error "${CROSS}${RD}This version of Proxmox Virtual Environment is not supported" - echo -e "Requires Proxmox Virtual Environment Version 8.1 or later." - echo -e "Exiting..." - sleep 2 - exit +pve_check() { + local PVE_VER + PVE_VER="$(pveversion | awk -F'/' '{print $2}' | awk -F'-' '{print $1}')" + + # Check for Proxmox VE 8.x + if [[ "$PVE_VER" =~ ^8\.([0-9]+) ]]; then + local MINOR="${BASH_REMATCH[1]}" + if ((MINOR < 1 || MINOR > 4)); then + msg_error "This version of Proxmox VE is not supported." + echo -e "Required: Proxmox VE version 8.1 – 8.4" + exit 1 + fi + return 0 fi + + # Check for Proxmox VE 9.x (Beta) — require confirmation + if [[ "$PVE_VER" =~ ^9\.([0-9]+) ]]; then + if whiptail --title "Proxmox 9.x Detected (Beta)" \ + --yesno "You are using Proxmox VE $PVE_VER, which is currently in Beta state.\n\nThis version is experimentally supported.\n\nDo you want to proceed anyway?" 12 70; then + msg_ok "Confirmed: Continuing with Proxmox VE $PVE_VER" + return 0 + else + msg_error "Aborted by user: Proxmox VE 9.x was not confirmed." + exit 1 + fi + fi + + # All other unsupported versions + msg_error "This version of Proxmox VE is not supported." + echo -e "Supported versions: Proxmox VE 8.1 – 8.4 or 9.x (Beta, with confirmation)" + exit 1 } function arch_check() { diff --git a/vm/openwrt.sh b/vm/openwrt.sh index 84660e19c..aad2fc08f 100644 --- a/vm/openwrt.sh +++ b/vm/openwrt.sh @@ -184,14 +184,37 @@ function msg_error() { echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } -function pve_check() { - if ! pveversion | grep -Eq "pve-manager/8\.[1-4](\.[0-9]+)*"; then - msg_error "This version of Proxmox Virtual Environment is not supported" - echo -e "Requires Proxmox Virtual Environment Version 8.1 or later." - echo -e "Exiting..." - sleep 2 - exit +pve_check() { + local PVE_VER + PVE_VER="$(pveversion | awk -F'/' '{print $2}' | awk -F'-' '{print $1}')" + + # Check for Proxmox VE 8.x + if [[ "$PVE_VER" =~ ^8\.([0-9]+) ]]; then + local MINOR="${BASH_REMATCH[1]}" + if ((MINOR < 1 || MINOR > 4)); then + msg_error "This version of Proxmox VE is not supported." + echo -e "Required: Proxmox VE version 8.1 – 8.4" + exit 1 + fi + return 0 fi + + # Check for Proxmox VE 9.x (Beta) — require confirmation + if [[ "$PVE_VER" =~ ^9\.([0-9]+) ]]; then + if whiptail --title "Proxmox 9.x Detected (Beta)" \ + --yesno "You are using Proxmox VE $PVE_VER, which is currently in Beta state.\n\nThis version is experimentally supported.\n\nDo you want to proceed anyway?" 12 70; then + msg_ok "Confirmed: Continuing with Proxmox VE $PVE_VER" + return 0 + else + msg_error "Aborted by user: Proxmox VE 9.x was not confirmed." + exit 1 + fi + fi + + # All other unsupported versions + msg_error "This version of Proxmox VE is not supported." + echo -e "Supported versions: Proxmox VE 8.1 – 8.4 or 9.x (Beta, with confirmation)" + exit 1 } function arch_check() { diff --git a/vm/opnsense-vm.sh b/vm/opnsense-vm.sh index ff2c2aac7..57abada7f 100644 --- a/vm/opnsense-vm.sh +++ b/vm/opnsense-vm.sh @@ -180,14 +180,37 @@ function msg_error() { echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } -function pve_check() { - if ! pveversion | grep -Eq "pve-manager/8\.[1-4](\.[0-9]+)*"; then - msg_error "This version of Proxmox Virtual Environment is not supported" - echo -e "Requires Proxmox Virtual Environment Version 8.1 or later." - echo -e "Exiting..." - sleep 2 - exit +pve_check() { + local PVE_VER + PVE_VER="$(pveversion | awk -F'/' '{print $2}' | awk -F'-' '{print $1}')" + + # Check for Proxmox VE 8.x + if [[ "$PVE_VER" =~ ^8\.([0-9]+) ]]; then + local MINOR="${BASH_REMATCH[1]}" + if ((MINOR < 1 || MINOR > 4)); then + msg_error "This version of Proxmox VE is not supported." + echo -e "Required: Proxmox VE version 8.1 – 8.4" + exit 1 + fi + return 0 fi + + # Check for Proxmox VE 9.x (Beta) — require confirmation + if [[ "$PVE_VER" =~ ^9\.([0-9]+) ]]; then + if whiptail --title "Proxmox 9.x Detected (Beta)" \ + --yesno "You are using Proxmox VE $PVE_VER, which is currently in Beta state.\n\nThis version is experimentally supported.\n\nDo you want to proceed anyway?" 12 70; then + msg_ok "Confirmed: Continuing with Proxmox VE $PVE_VER" + return 0 + else + msg_error "Aborted by user: Proxmox VE 9.x was not confirmed." + exit 1 + fi + fi + + # All other unsupported versions + msg_error "This version of Proxmox VE is not supported." + echo -e "Supported versions: Proxmox VE 8.1 – 8.4 or 9.x (Beta, with confirmation)" + exit 1 } function arch_check() { diff --git a/vm/owncloud-vm.sh b/vm/owncloud-vm.sh index 536ee3d82..689d7b23c 100644 --- a/vm/owncloud-vm.sh +++ b/vm/owncloud-vm.sh @@ -139,14 +139,37 @@ function check_root() { fi } -function pve_check() { - if ! pveversion | grep -Eq "pve-manager/8\.[1-4](\.[0-9]+)*"; then - msg_error "${CROSS}${RD}This version of Proxmox Virtual Environment is not supported" - echo -e "Requires Proxmox Virtual Environment Version 8.1 or later." - echo -e "Exiting..." - sleep 2 - exit +pve_check() { + local PVE_VER + PVE_VER="$(pveversion | awk -F'/' '{print $2}' | awk -F'-' '{print $1}')" + + # Check for Proxmox VE 8.x + if [[ "$PVE_VER" =~ ^8\.([0-9]+) ]]; then + local MINOR="${BASH_REMATCH[1]}" + if ((MINOR < 1 || MINOR > 4)); then + msg_error "This version of Proxmox VE is not supported." + echo -e "Required: Proxmox VE version 8.1 – 8.4" + exit 1 + fi + return 0 fi + + # Check for Proxmox VE 9.x (Beta) — require confirmation + if [[ "$PVE_VER" =~ ^9\.([0-9]+) ]]; then + if whiptail --title "Proxmox 9.x Detected (Beta)" \ + --yesno "You are using Proxmox VE $PVE_VER, which is currently in Beta state.\n\nThis version is experimentally supported.\n\nDo you want to proceed anyway?" 12 70; then + msg_ok "Confirmed: Continuing with Proxmox VE $PVE_VER" + return 0 + else + msg_error "Aborted by user: Proxmox VE 9.x was not confirmed." + exit 1 + fi + fi + + # All other unsupported versions + msg_error "This version of Proxmox VE is not supported." + echo -e "Supported versions: Proxmox VE 8.1 – 8.4 or 9.x (Beta, with confirmation)" + exit 1 } function arch_check() { diff --git a/vm/pimox-haos-vm.sh b/vm/pimox-haos-vm.sh index d941b97be..09852a80d 100644 --- a/vm/pimox-haos-vm.sh +++ b/vm/pimox-haos-vm.sh @@ -147,14 +147,37 @@ function check_root() { fi } -function pve_check() { - if ! pveversion | grep -Eq "pve-manager/8\.[1-4](\.[0-9]+)*"; then - msg_error "${CROSS}${RD}This version of Proxmox Virtual Environment is not supported" - echo -e "Requires Proxmox Virtual Environment Version 8.1 or later." - echo -e "Exiting..." - sleep 2 - exit +pve_check() { + local PVE_VER + PVE_VER="$(pveversion | awk -F'/' '{print $2}' | awk -F'-' '{print $1}')" + + # Check for Proxmox VE 8.x + if [[ "$PVE_VER" =~ ^8\.([0-9]+) ]]; then + local MINOR="${BASH_REMATCH[1]}" + if ((MINOR < 1 || MINOR > 4)); then + msg_error "This version of Proxmox VE is not supported." + echo -e "Required: Proxmox VE version 8.1 – 8.4" + exit 1 + fi + return 0 fi + + # Check for Proxmox VE 9.x (Beta) — require confirmation + if [[ "$PVE_VER" =~ ^9\.([0-9]+) ]]; then + if whiptail --title "Proxmox 9.x Detected (Beta)" \ + --yesno "You are using Proxmox VE $PVE_VER, which is currently in Beta state.\n\nThis version is experimentally supported.\n\nDo you want to proceed anyway?" 12 70; then + msg_ok "Confirmed: Continuing with Proxmox VE $PVE_VER" + return 0 + else + msg_error "Aborted by user: Proxmox VE 9.x was not confirmed." + exit 1 + fi + fi + + # All other unsupported versions + msg_error "This version of Proxmox VE is not supported." + echo -e "Supported versions: Proxmox VE 8.1 – 8.4 or 9.x (Beta, with confirmation)" + exit 1 } function arch_check() { diff --git a/vm/ubuntu2204-vm.sh b/vm/ubuntu2204-vm.sh index a662efb3c..7405ca070 100644 --- a/vm/ubuntu2204-vm.sh +++ b/vm/ubuntu2204-vm.sh @@ -134,14 +134,37 @@ function check_root() { fi } -function pve_check() { - if ! pveversion | grep -Eq "pve-manager/8\.[1-4](\.[0-9]+)*"; then - msg_error "${CROSS}${RD}This version of Proxmox Virtual Environment is not supported" - echo -e "Requires Proxmox Virtual Environment Version 8.1 or later." - echo -e "Exiting..." - sleep 2 - exit +pve_check() { + local PVE_VER + PVE_VER="$(pveversion | awk -F'/' '{print $2}' | awk -F'-' '{print $1}')" + + # Check for Proxmox VE 8.x + if [[ "$PVE_VER" =~ ^8\.([0-9]+) ]]; then + local MINOR="${BASH_REMATCH[1]}" + if ((MINOR < 1 || MINOR > 4)); then + msg_error "This version of Proxmox VE is not supported." + echo -e "Required: Proxmox VE version 8.1 – 8.4" + exit 1 + fi + return 0 fi + + # Check for Proxmox VE 9.x (Beta) — require confirmation + if [[ "$PVE_VER" =~ ^9\.([0-9]+) ]]; then + if whiptail --title "Proxmox 9.x Detected (Beta)" \ + --yesno "You are using Proxmox VE $PVE_VER, which is currently in Beta state.\n\nThis version is experimentally supported.\n\nDo you want to proceed anyway?" 12 70; then + msg_ok "Confirmed: Continuing with Proxmox VE $PVE_VER" + return 0 + else + msg_error "Aborted by user: Proxmox VE 9.x was not confirmed." + exit 1 + fi + fi + + # All other unsupported versions + msg_error "This version of Proxmox VE is not supported." + echo -e "Supported versions: Proxmox VE 8.1 – 8.4 or 9.x (Beta, with confirmation)" + exit 1 } function arch_check() { diff --git a/vm/ubuntu2404-vm.sh b/vm/ubuntu2404-vm.sh index 28f1f4e20..af4c4c81c 100644 --- a/vm/ubuntu2404-vm.sh +++ b/vm/ubuntu2404-vm.sh @@ -137,14 +137,37 @@ function check_root() { fi } -function pve_check() { - if ! pveversion | grep -Eq "pve-manager/8\.[1-4](\.[0-9]+)*"; then - msg_error "${CROSS}${RD}This version of Proxmox Virtual Environment is not supported" - echo -e "Requires Proxmox Virtual Environment Version 8.1 or later." - echo -e "Exiting..." - sleep 2 - exit +pve_check() { + local PVE_VER + PVE_VER="$(pveversion | awk -F'/' '{print $2}' | awk -F'-' '{print $1}')" + + # Check for Proxmox VE 8.x + if [[ "$PVE_VER" =~ ^8\.([0-9]+) ]]; then + local MINOR="${BASH_REMATCH[1]}" + if ((MINOR < 1 || MINOR > 4)); then + msg_error "This version of Proxmox VE is not supported." + echo -e "Required: Proxmox VE version 8.1 – 8.4" + exit 1 + fi + return 0 fi + + # Check for Proxmox VE 9.x (Beta) — require confirmation + if [[ "$PVE_VER" =~ ^9\.([0-9]+) ]]; then + if whiptail --title "Proxmox 9.x Detected (Beta)" \ + --yesno "You are using Proxmox VE $PVE_VER, which is currently in Beta state.\n\nThis version is experimentally supported.\n\nDo you want to proceed anyway?" 12 70; then + msg_ok "Confirmed: Continuing with Proxmox VE $PVE_VER" + return 0 + else + msg_error "Aborted by user: Proxmox VE 9.x was not confirmed." + exit 1 + fi + fi + + # All other unsupported versions + msg_error "This version of Proxmox VE is not supported." + echo -e "Supported versions: Proxmox VE 8.1 – 8.4 or 9.x (Beta, with confirmation)" + exit 1 } function arch_check() { diff --git a/vm/ubuntu2410-vm.sh b/vm/ubuntu2410-vm.sh index 1711430e8..21d76f8e9 100644 --- a/vm/ubuntu2410-vm.sh +++ b/vm/ubuntu2410-vm.sh @@ -136,14 +136,37 @@ function check_root() { fi } -function pve_check() { - if ! pveversion | grep -Eq "pve-manager/8\.[1-4](\.[0-9]+)*"; then - msg_error "${CROSS}${RD}This version of Proxmox Virtual Environment is not supported" - echo -e "Requires Proxmox Virtual Environment Version 8.1 or later." - echo -e "Exiting..." - sleep 2 - exit +pve_check() { + local PVE_VER + PVE_VER="$(pveversion | awk -F'/' '{print $2}' | awk -F'-' '{print $1}')" + + # Check for Proxmox VE 8.x + if [[ "$PVE_VER" =~ ^8\.([0-9]+) ]]; then + local MINOR="${BASH_REMATCH[1]}" + if ((MINOR < 1 || MINOR > 4)); then + msg_error "This version of Proxmox VE is not supported." + echo -e "Required: Proxmox VE version 8.1 – 8.4" + exit 1 + fi + return 0 fi + + # Check for Proxmox VE 9.x (Beta) — require confirmation + if [[ "$PVE_VER" =~ ^9\.([0-9]+) ]]; then + if whiptail --title "Proxmox 9.x Detected (Beta)" \ + --yesno "You are using Proxmox VE $PVE_VER, which is currently in Beta state.\n\nThis version is experimentally supported.\n\nDo you want to proceed anyway?" 12 70; then + msg_ok "Confirmed: Continuing with Proxmox VE $PVE_VER" + return 0 + else + msg_error "Aborted by user: Proxmox VE 9.x was not confirmed." + exit 1 + fi + fi + + # All other unsupported versions + msg_error "This version of Proxmox VE is not supported." + echo -e "Supported versions: Proxmox VE 8.1 – 8.4 or 9.x (Beta, with confirmation)" + exit 1 } function arch_check() { diff --git a/vm/ubuntu2504-vm.sh b/vm/ubuntu2504-vm.sh index 39e32d0ee..0e3355944 100644 --- a/vm/ubuntu2504-vm.sh +++ b/vm/ubuntu2504-vm.sh @@ -136,14 +136,37 @@ function check_root() { fi } -function pve_check() { - if ! pveversion | grep -Eq "pve-manager/8\.[1-4](\.[0-9]+)*"; then - msg_error "${CROSS}${RD}This version of Proxmox Virtual Environment is not supported" - echo -e "Requires Proxmox Virtual Environment Version 8.1 or later." - echo -e "Exiting..." - sleep 2 - exit +pve_check() { + local PVE_VER + PVE_VER="$(pveversion | awk -F'/' '{print $2}' | awk -F'-' '{print $1}')" + + # Check for Proxmox VE 8.x + if [[ "$PVE_VER" =~ ^8\.([0-9]+) ]]; then + local MINOR="${BASH_REMATCH[1]}" + if ((MINOR < 1 || MINOR > 4)); then + msg_error "This version of Proxmox VE is not supported." + echo -e "Required: Proxmox VE version 8.1 – 8.4" + exit 1 + fi + return 0 fi + + # Check for Proxmox VE 9.x (Beta) — require confirmation + if [[ "$PVE_VER" =~ ^9\.([0-9]+) ]]; then + if whiptail --title "Proxmox 9.x Detected (Beta)" \ + --yesno "You are using Proxmox VE $PVE_VER, which is currently in Beta state.\n\nThis version is experimentally supported.\n\nDo you want to proceed anyway?" 12 70; then + msg_ok "Confirmed: Continuing with Proxmox VE $PVE_VER" + return 0 + else + msg_error "Aborted by user: Proxmox VE 9.x was not confirmed." + exit 1 + fi + fi + + # All other unsupported versions + msg_error "This version of Proxmox VE is not supported." + echo -e "Supported versions: Proxmox VE 8.1 – 8.4 or 9.x (Beta, with confirmation)" + exit 1 } function arch_check() { diff --git a/vm/umbrel-os-vm.sh b/vm/umbrel-os-vm.sh index 38abfba57..2ba58dcf7 100644 --- a/vm/umbrel-os-vm.sh +++ b/vm/umbrel-os-vm.sh @@ -138,14 +138,37 @@ function check_root() { fi } -function pve_check() { - if ! pveversion | grep -Eq "pve-manager/8\.[1-4](\.[0-9]+)*"; then - msg_error "${CROSS}${RD}This version of Proxmox Virtual Environment is not supported" - echo -e "Requires Proxmox Virtual Environment Version 8.1 or later." - echo -e "Exiting..." - sleep 2 - exit +pve_check() { + local PVE_VER + PVE_VER="$(pveversion | awk -F'/' '{print $2}' | awk -F'-' '{print $1}')" + + # Check for Proxmox VE 8.x + if [[ "$PVE_VER" =~ ^8\.([0-9]+) ]]; then + local MINOR="${BASH_REMATCH[1]}" + if ((MINOR < 1 || MINOR > 4)); then + msg_error "This version of Proxmox VE is not supported." + echo -e "Required: Proxmox VE version 8.1 – 8.4" + exit 1 + fi + return 0 fi + + # Check for Proxmox VE 9.x (Beta) — require confirmation + if [[ "$PVE_VER" =~ ^9\.([0-9]+) ]]; then + if whiptail --title "Proxmox 9.x Detected (Beta)" \ + --yesno "You are using Proxmox VE $PVE_VER, which is currently in Beta state.\n\nThis version is experimentally supported.\n\nDo you want to proceed anyway?" 12 70; then + msg_ok "Confirmed: Continuing with Proxmox VE $PVE_VER" + return 0 + else + msg_error "Aborted by user: Proxmox VE 9.x was not confirmed." + exit 1 + fi + fi + + # All other unsupported versions + msg_error "This version of Proxmox VE is not supported." + echo -e "Supported versions: Proxmox VE 8.1 – 8.4 or 9.x (Beta, with confirmation)" + exit 1 } function arch_check() {