diff --git a/bedrock-entry.sh b/bedrock-entry.sh index 274fb07..861e188 100755 --- a/bedrock-entry.sh +++ b/bedrock-entry.sh @@ -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 -f allowlist.json fi - export WHITE_LIST ALLOW_LIST +else + ALLOW_LIST=false + rm -f allowlist.json 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