From 70c5ea3c1f7e560bf37ea99c642ddf7cdbe33f2b Mon Sep 17 00:00:00 2001 From: MickLesk <47820557+MickLesk@users.noreply.github.com> Date: Tue, 27 Oct 2026 10:22:38 +0100 Subject: [PATCH] TurnKey: offer only current appliances, stop on arm64 --- turnkey/turnkey.sh | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/turnkey/turnkey.sh b/turnkey/turnkey.sh index f79c6b715..a918af6b7 100644 --- a/turnkey/turnkey.sh +++ b/turnkey/turnkey.sh @@ -12,6 +12,8 @@ catch_errors APP="TurnKey LXC" NSAPP="turnkey" +# TurnKey publishes amd64 templates only +var_arm64="no" DIAGNOSTICS="no" METHOD="default" RANDOM_UUID="$(cat /proc/sys/kernel/random/uuid)" @@ -159,6 +161,7 @@ fi pve_check shell_check root_check +arch_check # Read diagnostics preference (same logic as build.func diagnostics_check) DIAG_CONFIG="/usr/local/community-scripts/diagnostics" @@ -178,6 +181,7 @@ msg_ok "Updated LXC template list" # Build TurnKey selection menu dynamically from available templates # Requires gawk for regex capture groups in match() +# Newest template per appliance, current or previous Debian only: the catalog still lists dropped appliances on EOL releases command -v gawk &>/dev/null || apt-get install -y gawk &>/dev/null declare -A TURNKEY_TEMPLATES TURNKEY_MENU=() @@ -187,10 +191,14 @@ while IFS=$'\t' read -r TEMPLATE_FILE TAG ITEM; do OFFSET=2 ((${#ITEM} + OFFSET > MSG_MAX_LENGTH)) && MSG_MAX_LENGTH=$((${#ITEM} + OFFSET)) TURNKEY_MENU+=("$TAG" "$ITEM " "OFF") -done < <(pveam available -section turnkeylinux | gawk '{ - tpl = $2 - if (match(tpl, /debian-([0-9]+)-turnkey-([^_]+)_([^_]+)_/, m)) { - app = m[2]; deb = m[1]; ver = m[3] +done < <(pveam available -section turnkeylinux | sort -k2,2V | gawk ' +match($2, /debian-([0-9]+)-turnkey-([^_]+)_([^_]+)_/, m) { + tpl[m[2]] = $2; deb[m[2]] = m[1] + 0; ver[m[2]] = m[3] + if (m[1] + 0 > newest) newest = m[1] + 0 +} +END { + for (app in tpl) { + if (deb[app] < newest - 1) continue display = app gsub(/-/, " ", display) n = split(display, words, " ") @@ -199,8 +207,7 @@ done < <(pveam available -section turnkeylinux | gawk '{ words[i] = toupper(substr(words[i], 1, 1)) substr(words[i], 2) display = display (i > 1 ? " " : "") words[i] } - tag = app "-" deb - printf "%s\t%s\t%s | Debian %s | %s\n", tpl, tag, display, deb, ver + printf "%s\t%s-%s\t%s | Debian %s | %s\n", tpl[app], app, deb[app], display, deb[app], ver[app] } }' | sort -t$'\t' -k2,2)