Skip to content

Commit de356fa

Browse files
committed
set gawk
1 parent 00c538d commit de356fa

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

turnkey/turnkey.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ pveam update >/dev/null
177177
msg_ok "Updated LXC template list"
178178

179179
# Build TurnKey selection menu dynamically from available templates
180+
# Requires gawk for regex capture groups in match()
181+
command -v gawk &>/dev/null || apt-get install -y gawk &>/dev/null
180182
declare -A TURNKEY_TEMPLATES
181183
TURNKEY_MENU=()
182184
MSG_MAX_LENGTH=0
@@ -185,7 +187,7 @@ while IFS=$'\t' read -r TEMPLATE_FILE TAG ITEM; do
185187
OFFSET=2
186188
((${#ITEM} + OFFSET > MSG_MAX_LENGTH)) && MSG_MAX_LENGTH=$((${#ITEM} + OFFSET))
187189
TURNKEY_MENU+=("$TAG" "$ITEM " "OFF")
188-
done < <(pveam available -section turnkeylinux | awk '{
190+
done < <(pveam available -section turnkeylinux | gawk '{
189191
tpl = $2
190192
if (match(tpl, /debian-([0-9]+)-turnkey-([^_]+)_([^_]+)_/, m)) {
191193
app = m[2]; deb = m[1]; ver = m[3]

0 commit comments

Comments
 (0)