Update build.func

This commit is contained in:
CanbiZ 2025-07-21 11:44:41 +02:00
parent 715bd48f9f
commit 436026dc1c

View File

@ -77,15 +77,37 @@ root_check() {
# This function checks the version of Proxmox Virtual Environment (PVE) and exits if the version is not supported. # This function checks the version of Proxmox Virtual Environment (PVE) and exits if the version is not supported.
pve_check() { pve_check() {
if ! pveversion | grep -Eq "pve-manager/8\.[0-4](\.[0-9]+)*"; then local PVE_VER
msg_error "${CROSS}${RD}This version of Proxmox Virtual Environment is not supported" PVE_VER="$(pveversion | awk -F'/' '{print $2}' | awk -F'-' '{print $1}')"
echo -e "Requires Proxmox Virtual Environment Version 8.1 or later."
echo -e "Exiting..." # 8 Version Check
sleep 2 if [[ "$PVE_VER" =~ ^8\.([0-9]+) ]]; then
exit local MINOR="${BASH_REMATCH[1]}"
if (( MINOR < 1 || MINOR > 4 )); then
msg_error "This version of Proxmox Virtual Environment is not supported"
echo -e "Requires Proxmox Virtual Environment Version 8.1 8.4"
echo -e "Exiting..."
sleep 2
exit 1
fi
return 0
fi fi
# 9 Beta Version Check
if [[ "$PVE_VER" =~ ^9\.([0-9]+) ]]; then
msg_custom "Detected Proxmox Virtual Environment $PVE_VER Beta state, use with caution!"
return 0
fi
# All others (unsupported versions)
msg_error "This version of Proxmox Virtual Environment is not supported"
echo -e "Requires Proxmox Virtual Environment Version 8.1 8.4 or 9.x (Beta)"
echo -e "Exiting..."
sleep 2
exit 1
} }
# When a node is running tens of containers, it's possible to exceed the kernel's cryptographic key storage allocations. # When a node is running tens of containers, it's possible to exceed the kernel's cryptographic key storage allocations.
# These are tuneable, so verify if the currently deployment is approaching the limits, advise the user on how to tune the limits, and exit the script. # These are tuneable, so verify if the currently deployment is approaching the limits, advise the user on how to tune the limits, and exit the script.
# https://cleveruptime.com/docs/files/proc-key-users | https://docs.kernel.org/security/keys/core.html # https://cleveruptime.com/docs/files/proc-key-users | https://docs.kernel.org/security/keys/core.html