mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-10-28 02:00:14 +01:00
TurnKey: offer only current appliances, stop on arm64 (#18265)
* TurnKey: offer only current appliances, stop on arm64 * Update turnkey/turnkey.sh --------- Co-authored-by: Sam Heinz <sam@samheinz.com>
This commit is contained in:
committed by
GitHub
parent
d864252eb8
commit
4439ef2f3f
+12
-6
@@ -12,6 +12,7 @@ catch_errors
|
|||||||
|
|
||||||
APP="TurnKey LXC"
|
APP="TurnKey LXC"
|
||||||
NSAPP="turnkey"
|
NSAPP="turnkey"
|
||||||
|
var_arm64="no"
|
||||||
DIAGNOSTICS="no"
|
DIAGNOSTICS="no"
|
||||||
METHOD="default"
|
METHOD="default"
|
||||||
RANDOM_UUID="$(cat /proc/sys/kernel/random/uuid)"
|
RANDOM_UUID="$(cat /proc/sys/kernel/random/uuid)"
|
||||||
@@ -159,6 +160,7 @@ fi
|
|||||||
pve_check
|
pve_check
|
||||||
shell_check
|
shell_check
|
||||||
root_check
|
root_check
|
||||||
|
arch_check
|
||||||
|
|
||||||
# Read diagnostics preference (same logic as build.func diagnostics_check)
|
# Read diagnostics preference (same logic as build.func diagnostics_check)
|
||||||
DIAG_CONFIG="/usr/local/community-scripts/diagnostics"
|
DIAG_CONFIG="/usr/local/community-scripts/diagnostics"
|
||||||
@@ -178,6 +180,7 @@ msg_ok "Updated LXC template list"
|
|||||||
|
|
||||||
# Build TurnKey selection menu dynamically from available templates
|
# Build TurnKey selection menu dynamically from available templates
|
||||||
# Requires gawk for regex capture groups in match()
|
# 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
|
command -v gawk &>/dev/null || apt-get install -y gawk &>/dev/null
|
||||||
declare -A TURNKEY_TEMPLATES
|
declare -A TURNKEY_TEMPLATES
|
||||||
TURNKEY_MENU=()
|
TURNKEY_MENU=()
|
||||||
@@ -187,10 +190,14 @@ while IFS=$'\t' read -r TEMPLATE_FILE TAG ITEM; do
|
|||||||
OFFSET=2
|
OFFSET=2
|
||||||
((${#ITEM} + OFFSET > MSG_MAX_LENGTH)) && MSG_MAX_LENGTH=$((${#ITEM} + OFFSET))
|
((${#ITEM} + OFFSET > MSG_MAX_LENGTH)) && MSG_MAX_LENGTH=$((${#ITEM} + OFFSET))
|
||||||
TURNKEY_MENU+=("$TAG" "$ITEM " "OFF")
|
TURNKEY_MENU+=("$TAG" "$ITEM " "OFF")
|
||||||
done < <(pveam available -section turnkeylinux | gawk '{
|
done < <(pveam available -section turnkeylinux | sort -k2,2V | gawk '
|
||||||
tpl = $2
|
match($2, /debian-([0-9]+)-turnkey-([^_]+)_([^_]+)_/, m) {
|
||||||
if (match(tpl, /debian-([0-9]+)-turnkey-([^_]+)_([^_]+)_/, m)) {
|
tpl[m[2]] = $2; deb[m[2]] = m[1] + 0; ver[m[2]] = m[3]
|
||||||
app = m[2]; deb = m[1]; ver = m[3]
|
if (m[1] + 0 > newest) newest = m[1] + 0
|
||||||
|
}
|
||||||
|
END {
|
||||||
|
for (app in tpl) {
|
||||||
|
if (deb[app] < newest - 1) continue
|
||||||
display = app
|
display = app
|
||||||
gsub(/-/, " ", display)
|
gsub(/-/, " ", display)
|
||||||
n = split(display, words, " ")
|
n = split(display, words, " ")
|
||||||
@@ -199,8 +206,7 @@ done < <(pveam available -section turnkeylinux | gawk '{
|
|||||||
words[i] = toupper(substr(words[i], 1, 1)) substr(words[i], 2)
|
words[i] = toupper(substr(words[i], 1, 1)) substr(words[i], 2)
|
||||||
display = display (i > 1 ? " " : "") words[i]
|
display = display (i > 1 ? " " : "") words[i]
|
||||||
}
|
}
|
||||||
tag = app "-" deb
|
printf "%s\t%s-%s\t%s | Debian %s | %s\n", tpl[app], app, deb[app], display, deb[app], ver[app]
|
||||||
printf "%s\t%s\t%s | Debian %s | %s\n", tpl, tag, display, deb, ver
|
|
||||||
}
|
}
|
||||||
}' | sort -t$'\t' -k2,2)
|
}' | sort -t$'\t' -k2,2)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user