Netdata: Fix pve_check for 8 (#7392)
This commit is contained in:
parent
d314168a37
commit
6fa12cc814
@ -41,39 +41,37 @@ function msg_ok() {
|
||||
|
||||
function msg_error() { echo -e "${RD}✗ $1${CL}"; }
|
||||
|
||||
# This function checks the version of Proxmox Virtual Environment (PVE) and exits if the version is not supported.
|
||||
# Supported: Proxmox VE 8.0.x – 8.9.x and 9.0 (NOT 9.1+)
|
||||
pve_check() {
|
||||
if ! command -v pveversion >/dev/null 2>&1; then
|
||||
msg_error "This script can only be run on a Proxmox VE host."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local PVE_VER
|
||||
PVE_VER="$(pveversion | awk -F'/' '{print $2}' | awk -F'-' '{print $1}')"
|
||||
|
||||
# Proxmox VE 8.x: allow 8.0 – 8.9
|
||||
if [[ "$PVE_VER" =~ ^9\.([0-9]+)(\.[0-9]+)?$ ]]; then
|
||||
# Check for Proxmox VE 8.x: allow 8.0–8.9
|
||||
if [[ "$PVE_VER" =~ ^8\.([0-9]+) ]]; then
|
||||
local MINOR="${BASH_REMATCH[1]}"
|
||||
if ((MINOR != 0)); then
|
||||
msg_error "Unsupported Proxmox VE version: $PVE_VER"
|
||||
msg_error "Supported versions: 8.0 – 8.9 or 9.0.x"
|
||||
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
|
||||
fi
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Proxmox VE 9.x: allow only 9.0
|
||||
if [[ "$PVE_VER" =~ ^9\.([0-9]+)$ ]]; then
|
||||
# Check for Proxmox VE 9.x: allow ONLY 9.0
|
||||
if [[ "$PVE_VER" =~ ^9\.([0-9]+) ]]; then
|
||||
local MINOR="${BASH_REMATCH[1]}"
|
||||
if ((MINOR != 0)); then
|
||||
msg_error "Unsupported Proxmox VE version: $PVE_VER"
|
||||
msg_error "Supported versions: 8.0 – 8.9 or 9.0"
|
||||
msg_error "This version of Proxmox VE is not yet supported."
|
||||
msg_error "Supported: Proxmox VE version 9.0"
|
||||
exit 1
|
||||
fi
|
||||
return 0
|
||||
fi
|
||||
|
||||
msg_error "Unsupported Proxmox VE version: $PVE_VER"
|
||||
msg_error "Supported versions: 8.0 – 8.9 or 9.0"
|
||||
# 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"
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user