Compare commits

...

1 Commits

Author SHA1 Message Date
MickLesk 67eea596e3 all-templates: answering No or Cancel is not a failure
Both whiptail prompts ran bare under errexit, so No on the first question
or Cancel in the template list ended in the error handler and was reported
as a failed run (3 of 5 failures in three days).

Monitor-All is now stopped right before the download instead of at the
start, so leaving at a prompt no longer leaves it stopped.
2026-11-03 10:28:53 +01:00
+7 -6
View File
@@ -70,14 +70,10 @@ function cleanup_ctid() {
header_info
require_pve_host
# Stop Proxmox VE Monitor-All if running
if systemctl is-active -q ping-instances.service; then
systemctl stop ping-instances.service
fi
msg_info "Updating template list"
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 || exit 0
TEMPLATE_MENU=()
MSG_MAX_LENGTH=0
HOST_ARCH=$(dpkg --print-architecture)
@@ -87,7 +83,7 @@ while read -r TAG ITEM ARCH; do
((${#ITEM} + OFFSET > MSG_MAX_LENGTH)) && MSG_MAX_LENGTH=${#ITEM}+OFFSET
TEMPLATE_MENU+=("$ITEM" "$TAG " "OFF")
done < <(pveam available)
TEMPLATE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "All Template LXCs" --radiolist "\nSelect a Template LXC to create:\n" 16 $((MSG_MAX_LENGTH + 58)) 10 "${TEMPLATE_MENU[@]}" 3>&1 1>&2 2>&3 | tr -d '"')
TEMPLATE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "All Template LXCs" --radiolist "\nSelect a Template LXC to create:\n" 16 $((MSG_MAX_LENGTH + 58)) 10 "${TEMPLATE_MENU[@]}" 3>&1 1>&2 2>&3 | tr -d '"') || exit 0
[ -z "$TEMPLATE" ] && {
whiptail --backtitle "Proxmox VE Helper Scripts" --title "No Template LXC Selected" --msgbox "It appears that no Template LXC container was selected" 10 68
echo "Done"
@@ -185,6 +181,11 @@ msg_ok "Using '$TEMPLATE_STORAGE' for template storage."
CONTAINER_STORAGE=$(select_storage container)
msg_ok "Using '$CONTAINER_STORAGE' for container storage."
# Stop Proxmox VE Monitor-All if running
if systemctl is-active -q ping-instances.service; then
systemctl stop ping-instances.service
fi
# Download template
msg_info "Downloading LXC template (Patience)"
pveam download "$TEMPLATE_STORAGE" "$TEMPLATE" >/dev/null || {