all-templates: handle the arch column of pveam available (#17579)

This commit is contained in:
CanbiZ (MickLesk)
2026-09-29 15:17:27 +02:00
committed by GitHub
parent ed7b22866a
commit 8fdc522129
+9 -6
View File
@@ -74,12 +74,15 @@ require_pve_host
if systemctl is-active -q ping-instances.service; then if systemctl is-active -q ping-instances.service; then
systemctl stop ping-instances.service systemctl stop ping-instances.service
fi fi
msg_info "Loading" msg_info "Updating template list"
pveam update >/dev/null 2>&1 pveam update >/dev/null 2>&1
msg_ok "Updated template list"
whiptail --backtitle "Proxmox VE Helper Scripts" --title "All Templates" --yesno "This will allow for the creation of one of the many Template LXC Containers. Proceed?" 10 68 whiptail --backtitle "Proxmox VE Helper Scripts" --title "All Templates" --yesno "This will allow for the creation of one of the many Template LXC Containers. Proceed?" 10 68
TEMPLATE_MENU=() TEMPLATE_MENU=()
MSG_MAX_LENGTH=0 MSG_MAX_LENGTH=0
while read -r TAG ITEM; do HOST_ARCH=$(dpkg --print-architecture)
while read -r TAG ITEM ARCH; do
[[ -n "$ARCH" && "$ARCH" != "unknown" && "$ARCH" != "$HOST_ARCH" ]] && continue
OFFSET=2 OFFSET=2
((${#ITEM} + OFFSET > MSG_MAX_LENGTH)) && MSG_MAX_LENGTH=${#ITEM}+OFFSET ((${#ITEM} + OFFSET > MSG_MAX_LENGTH)) && MSG_MAX_LENGTH=${#ITEM}+OFFSET
TEMPLATE_MENU+=("$ITEM" "$TAG " "OFF") TEMPLATE_MENU+=("$ITEM" "$TAG " "OFF")
@@ -100,7 +103,7 @@ CTID=$(pvesh get /cluster/nextid)
if ! validate_container_id "$CTID"; then if ! validate_container_id "$CTID"; then
msg_warn "Container ID $CTID is already in use." msg_warn "Container ID $CTID is already in use."
CTID=$(get_valid_container_id "$CTID") CTID=$(get_valid_container_id "$CTID")
msg_info "Using next available ID: $CTID" msg_ok "Using next available ID: $CTID"
fi fi
PCT_OPTIONS=" PCT_OPTIONS="
@@ -176,15 +179,15 @@ function select_storage() {
# Get template storage # Get template storage
TEMPLATE_STORAGE=$(select_storage template) TEMPLATE_STORAGE=$(select_storage template)
msg_info "Using '$TEMPLATE_STORAGE' for template storage." msg_ok "Using '$TEMPLATE_STORAGE' for template storage."
# Get container storage # Get container storage
CONTAINER_STORAGE=$(select_storage container) CONTAINER_STORAGE=$(select_storage container)
msg_info "Using '$CONTAINER_STORAGE' for container storage." msg_ok "Using '$CONTAINER_STORAGE' for container storage."
# Download template # Download template
msg_info "Downloading LXC template (Patience)" msg_info "Downloading LXC template (Patience)"
pveam download $TEMPLATE_STORAGE $TEMPLATE >/dev/null || { pveam download "$TEMPLATE_STORAGE" "$TEMPLATE" >/dev/null || {
msg_error "A problem occured while downloading the LXC template." msg_error "A problem occured while downloading the LXC template."
exit 222 exit 222
} }