diff --git a/bedrock-entry.sh b/bedrock-entry.sh index ad9404f..c0f43d0 100755 --- a/bedrock-entry.sh +++ b/bedrock-entry.sh @@ -165,22 +165,25 @@ if [ -n "$OPS" ] || [ -n "$MEMBERS" ] || [ -n "$VISITORS" ]; then ]| flatten' > permissions.json fi -allowListUsers=${ALLOW_LIST_USERS:-${WHITE_LIST_USERS}} -if [ -n "$allowListUsers" ]; then - echo "Setting allow list" - f=allowlist.json - rm -rf "$f" - jq -c -n --arg users "$allowListUsers" '$users | split(",") | map({"ignoresPlayerLimit":false,"name": .})' > "$f" - # activate server property to enable list usage - WHITE_LIST=true - ALLOW_LIST=true -else - rm -rf whitelist.json allowlist.json - : "${WHITE_LIST:=false}" - : "${ALLOW_LIST:=false}" +if [[ -v ALLOW_LIST_USERS || -v WHITE_LIST_USERS ]]; then + allowListUsers=${ALLOW_LIST_USERS:-${WHITE_LIST_USERS}} + + if [[ $allowListUsers ]]; then + echo "Setting allow list" + f=allowlist.json + rm -rf "$f" + jq -c -n --arg users "$allowListUsers" '$users | split(",") | map({"ignoresPlayerLimit":false,"name": .})' > "$f" + # activate server property to enable list usage + WHITE_LIST=true + ALLOW_LIST=true + else + rm -rf whitelist.json allowlist.json + WHITE_LIST=false + ALLOW_LIST=false + fi + export WHITE_LIST ALLOW_LIST fi -export WHITE_LIST ALLOW_LIST set-property --file server.properties --bulk /etc/bds-property-definitions.json