From 6924a6fea44901764170378331b7fc1cf1a21f78 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 30 Jan 2025 11:26:30 +0100 Subject: [PATCH] Optimize PVE Manager Version-Check (#1866) --- misc/add-lxc-iptag.sh | 2 +- misc/build.func | 2 +- misc/post-pve-install.sh | 2 +- vm/archlinux-vm.sh | 2 +- vm/debian-vm.sh | 2 +- vm/docker-vm.sh | 2 +- vm/haos-vm.sh | 2 +- vm/mikrotik-routeros.sh | 2 +- vm/nextcloud-vm.sh | 2 +- vm/openwrt.sh | 2 +- vm/owncloud-vm.sh | 2 +- vm/ubuntu2204-vm.sh | 2 +- vm/ubuntu2404-vm.sh | 2 +- vm/ubuntu2410-vm.sh | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/misc/add-lxc-iptag.sh b/misc/add-lxc-iptag.sh index 7ef23341f..e838f1df8 100644 --- a/misc/add-lxc-iptag.sh +++ b/misc/add-lxc-iptag.sh @@ -102,7 +102,7 @@ while true; do esac done -if ! pveversion | grep -Eq "pve-manager/8.[0-3]"; then +if ! pveversion | grep -Eq "pve-manager/8\.[0-3](\.[0-9]+)*"; then msg_error "This version of Proxmox Virtual Environment is not supported" msg_error "⚠️ Requires Proxmox Virtual Environment Version 8.0 or later." msg_error "Exiting..." diff --git a/misc/build.func b/misc/build.func index 42e18452f..e68ef09af 100644 --- a/misc/build.func +++ b/misc/build.func @@ -140,7 +140,7 @@ 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.[1-3]"; then + if ! pveversion | grep -Eq "pve-manager/8\.[1-3](\.[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..." diff --git a/misc/post-pve-install.sh b/misc/post-pve-install.sh index 4290c50f6..aeba762cd 100644 --- a/misc/post-pve-install.sh +++ b/misc/post-pve-install.sh @@ -231,7 +231,7 @@ while true; do esac done -if ! pveversion | grep -Eq "pve-manager/8.[0-3]"; then +if ! pveversion | grep -Eq "pve-manager/8\.[0-3](\.[0-9]+)*"; then msg_error "This version of Proxmox Virtual Environment is not supported" echo -e "Requires Proxmox Virtual Environment Version 8.0 or later." echo -e "Exiting..." diff --git a/vm/archlinux-vm.sh b/vm/archlinux-vm.sh index 6f08a0023..3ed539fff 100644 --- a/vm/archlinux-vm.sh +++ b/vm/archlinux-vm.sh @@ -111,7 +111,7 @@ function check_root() { } function pve_check() { - if ! pveversion | grep -Eq "pve-manager/8.[1-3]"; then + if ! pveversion | grep -Eq "pve-manager/8\.[1-3](\.[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..." diff --git a/vm/debian-vm.sh b/vm/debian-vm.sh index 857c0ad60..856078554 100644 --- a/vm/debian-vm.sh +++ b/vm/debian-vm.sh @@ -111,7 +111,7 @@ function check_root() { } function pve_check() { - if ! pveversion | grep -Eq "pve-manager/8.[1-3]"; then + if ! pveversion | grep -Eq "pve-manager/8\.[1-3](\.[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..." diff --git a/vm/docker-vm.sh b/vm/docker-vm.sh index db855d504..280aeb4c3 100644 --- a/vm/docker-vm.sh +++ b/vm/docker-vm.sh @@ -91,7 +91,7 @@ function check_root() { } function pve_check() { - if ! pveversion | grep -Eq "pve-manager/8.[1-3]"; then + if ! pveversion | grep -Eq "pve-manager/8\.[1-3](\.[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..." diff --git a/vm/haos-vm.sh b/vm/haos-vm.sh index 87ba35c90..0b4be157c 100644 --- a/vm/haos-vm.sh +++ b/vm/haos-vm.sh @@ -115,7 +115,7 @@ function check_root() { } function pve_check() { - if ! pveversion | grep -Eq "pve-manager/8.[1-3]"; then + if ! pveversion | grep -Eq "pve-manager/8\.[1-3](\.[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..." diff --git a/vm/mikrotik-routeros.sh b/vm/mikrotik-routeros.sh index 816dea9f2..ce5085fbd 100644 --- a/vm/mikrotik-routeros.sh +++ b/vm/mikrotik-routeros.sh @@ -62,7 +62,7 @@ function cleanup() { } TEMP_DIR=$(mktemp -d) pushd $TEMP_DIR >/dev/null -if ! pveversion | grep -Eq "pve-manager/8.[1-3]"; then +if ! pveversion | grep -Eq "pve-manager/8\.[1-3](\.[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..." diff --git a/vm/nextcloud-vm.sh b/vm/nextcloud-vm.sh index d93b7b95f..b7db4c895 100644 --- a/vm/nextcloud-vm.sh +++ b/vm/nextcloud-vm.sh @@ -91,7 +91,7 @@ function check_root() { } function pve_check() { - if ! pveversion | grep -Eq "pve-manager/8.[1-3]"; then + if ! pveversion | grep -Eq "pve-manager/8\.[1-3](\.[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..." diff --git a/vm/openwrt.sh b/vm/openwrt.sh index f7488f958..c6945713c 100644 --- a/vm/openwrt.sh +++ b/vm/openwrt.sh @@ -157,7 +157,7 @@ function msg_error() { } function pve_check() { - if ! pveversion | grep -Eq "pve-manager/8.[1-3]"; then + if ! pveversion | grep -Eq "pve-manager/8\.[1-3](\.[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..." diff --git a/vm/owncloud-vm.sh b/vm/owncloud-vm.sh index e004866c1..f81d0fb74 100644 --- a/vm/owncloud-vm.sh +++ b/vm/owncloud-vm.sh @@ -91,7 +91,7 @@ function check_root() { } function pve_check() { - if ! pveversion | grep -Eq "pve-manager/8.[1-3]"; then + if ! pveversion | grep -Eq "pve-manager/8\.[1-3](\.[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..." diff --git a/vm/ubuntu2204-vm.sh b/vm/ubuntu2204-vm.sh index 501321973..e60d7b628 100644 --- a/vm/ubuntu2204-vm.sh +++ b/vm/ubuntu2204-vm.sh @@ -111,7 +111,7 @@ function check_root() { } function pve_check() { - if ! pveversion | grep -Eq "pve-manager/8.[1-3]"; then + if ! pveversion | grep -Eq "pve-manager/8\.[1-3](\.[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..." diff --git a/vm/ubuntu2404-vm.sh b/vm/ubuntu2404-vm.sh index b6b18809b..3d8917913 100644 --- a/vm/ubuntu2404-vm.sh +++ b/vm/ubuntu2404-vm.sh @@ -112,7 +112,7 @@ function check_root() { } function pve_check() { - if ! pveversion | grep -Eq "pve-manager/8.[1-3]"; then + if ! pveversion | grep -Eq "pve-manager/8\.[1-3](\.[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..." diff --git a/vm/ubuntu2410-vm.sh b/vm/ubuntu2410-vm.sh index a512d81d6..53a0898c7 100644 --- a/vm/ubuntu2410-vm.sh +++ b/vm/ubuntu2410-vm.sh @@ -111,7 +111,7 @@ function check_root() { } function pve_check() { - if ! pveversion | grep -Eq "pve-manager/8.[1-3]"; then + if ! pveversion | grep -Eq "pve-manager/8\.[1-3](\.[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..."