Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions bedrock-entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -165,23 +165,24 @@ if [ -n "$OPS" ] || [ -n "$MEMBERS" ] || [ -n "$VISITORS" ]; then
]| flatten' > permissions.json
fi

if [[ -n "$ALLOW_LIST_USERS" || -n "$WHITE_LIST_USERS" ]]; then
allowListUsers=${ALLOW_LIST_USERS:-$WHITE_LIST_USERS}

if [[ -v ALLOW_LIST_USERS || -v WHITE_LIST_USERS ]]; then
allowListUsers=${ALLOW_LIST_USERS:-${WHITE_LIST_USERS}}

WHITE_LIST=false
rm -f whitelist.json
if [[ $allowListUsers ]]; then
if [[ "$allowListUsers" ]]; then
echo "Setting allow list"
jq -c -n --arg users "$allowListUsers" '$users | split(",") | map({"ignoresPlayerLimit":false,"name": .})' > "allowlist.json"
# activate server property to enable list usage
ALLOW_LIST=true
else
rm -rf allowlist.json
ALLOW_LIST=false
rm allowlist.json
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just in case the file isn't present

Suggested change
rm allowlist.json
rm -f allowlist.json

fi
export WHITE_LIST ALLOW_LIST
else
ALLOW_LIST=false
rm allowlist.json
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here

fi
sed -i '/^white-list=.*/d' server.properties #Removes white-list= line from server.properties
export ALLOW_LIST

set-property --file server.properties --bulk /etc/bds-property-definitions.json

Expand Down