Skip to content

Commit 238b6e8

Browse files
authored
Fix ALLOW_LIST_USERS parsing. (#613)
1 parent 8ebb70e commit 238b6e8

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

bedrock-entry.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,9 +362,9 @@ if [[ -n "$ALLOW_LIST_USERS" || -n "$WHITE_LIST_USERS" ]]; then
362362
if [[ "$allowListUsers" ]]; then
363363
echo "Setting allow list"
364364
if [[ "$allowListUsers" != *":"* ]]; then
365-
jq -c -n --arg users "$allowListUsers" '$users | split("[,\n]+") | map(select(length>0) | {"ignoresPlayerLimit":false,"name": .})' > "allowlist.json"
365+
jq -c -n --arg users "$allowListUsers" '$users | split("[,\\n]+"; "") | map(select(length>0) | {"ignoresPlayerLimit":false,"name": .})' > "allowlist.json"
366366
else
367-
jq -c -n --arg users "$allowListUsers" '$users | split("[,\n]+") | map(select(length>0) | split(":") | {"ignoresPlayerLimit":false,"name": .[0], "xuid": .[1]})' > "allowlist.json"
367+
jq -c -n --arg users "$allowListUsers" '$users | split("[,\\n]+"; "") | map(select(length>0) | split(":") | {"ignoresPlayerLimit":false,"name": .[0], "xuid": .[1]})' > "allowlist.json"
368368
fi
369369
# activate server property to enable list usage
370370
ALLOW_LIST=true
@@ -390,7 +390,7 @@ if [[ -n "$VARIABLES" ]]; then
390390
# Note: Values should not contain unescaped commas or colons
391391
jq -n --arg vars "$VARIABLES" '
392392
$vars
393-
| split("[,\n]+")
393+
| split("[,\\n]+"; "")
394394
| map(
395395
select(length>0) |
396396
split("=") as $kv |

0 commit comments

Comments
 (0)