From 907120356ef52ea6dae0661866c8fd3a8d266966 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 1 Jul 2025 11:24:51 +0200 Subject: [PATCH] Update create_lxc.sh --- misc/create_lxc.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/misc/create_lxc.sh b/misc/create_lxc.sh index 5874ac69..5b792c6e 100644 --- a/misc/create_lxc.sh +++ b/misc/create_lxc.sh @@ -240,12 +240,18 @@ if ! pveam list "$TEMPLATE_STORAGE" | grep -q "$TEMPLATE" || ! zstdcat "$TEMPLAT for attempt in {1..3}; do msg_info "Attempt $attempt: Downloading LXC template..." - if timeout 120 pveam download "$TEMPLATE_STORAGE" "$TEMPLATE" >/dev/null 2>&1; then + if command -v timeout >/dev/null; then + timeout --foreground 120 pveam download "$TEMPLATE_STORAGE" "$TEMPLATE" >/dev/null 2>&1 + else + pveam download "$TEMPLATE_STORAGE" "$TEMPLATE" >/dev/null 2>&1 + fi + + if [[ $? -eq 0 ]]; then msg_ok "Template download successful." break fi - if [ $attempt -eq 3 ]; then + if [[ $attempt -eq 3 ]]; then msg_error "Failed after 3 attempts. Please check your Proxmox host’s internet access or manually run:\n pveam download $TEMPLATE_STORAGE $TEMPLATE" exit 208 fi