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 7ef23341..e838f1df 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 42e18452..e68ef09a 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 4290c50f..aeba762c 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 6f08a002..3ed539ff 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 857c0ad6..85607855 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 db855d50..280aeb4c 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 87ba35c9..0b4be157 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 816dea9f..ce5085fb 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 d93b7b95..b7db4c89 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 f7488f95..c6945713 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 e004866c..f81d0fb7 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 50132197..e60d7b62 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 b6b18809..3d891791 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 a512d81d..53a0898c 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..."