Set default LANG in locale configuration (#9440)

Ensures LANG is set to en_US.UTF-8 by default if not already defined before updating /etc/locale.gen.
This commit is contained in:
CanbiZ 2025-11-25 20:32:18 +01:00 committed by GitHub
parent 949ecc39ad
commit d2a103c230
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1338,7 +1338,8 @@ EOF'
pct exec "$CTID" -- ash -c "apk add bash newt curl openssh nano mc ncurses jq >/dev/null"
else
sleep 3
pct exec "$CTID" -- bash -c "sed -i '/$LANG/ s/^# //' /etc/locale.gen"
LANG=${LANG:-en_US.UTF-8}
pct exec "$CTID" -- bash -c "sed -i \"/$LANG/ s/^# //\" /etc/locale.gen"
pct exec "$CTID" -- bash -c "locale_line=\$(grep -v '^#' /etc/locale.gen | grep -E '^[a-zA-Z]' | awk '{print \$1}' | head -n 1) && \
echo LANG=\$locale_line >/etc/default/locale && \
locale-gen >/dev/null && \