Only remove allowlist.json when ALLOW_LIST_USERS is set to empty string (#338)
This commit is contained in:
1 parent
a77ed28d69
commit
8756c97fab
1 file changed
+17
-14
+17
-14
@@ -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
|
||||
|
||||
|
||||
Reference in new issue
Block a user