File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -165,23 +165,24 @@ if [ -n "$OPS" ] || [ -n "$MEMBERS" ] || [ -n "$VISITORS" ]; then
165165 ]| flatten' > permissions.json
166166fi
167167
168+ if [[ -n " $ALLOW_LIST_USERS " || -n " $WHITE_LIST_USERS " ]]; then
169+ allowListUsers=${ALLOW_LIST_USERS:- $WHITE_LIST_USERS }
168170
169- if [[ -v ALLOW_LIST_USERS || -v WHITE_LIST_USERS ]]; then
170- allowListUsers=${ALLOW_LIST_USERS:- ${WHITE_LIST_USERS} }
171-
172- WHITE_LIST=false
173- rm -f whitelist.json
174- if [[ $allowListUsers ]]; then
171+ if [[ " $allowListUsers " ]]; then
175172 echo " Setting allow list"
176173 jq -c -n --arg users " $allowListUsers " ' $users | split(",") | map({"ignoresPlayerLimit":false,"name": .})' > " allowlist.json"
177174 # activate server property to enable list usage
178175 ALLOW_LIST=true
179176 else
180- rm -rf allowlist.json
181177 ALLOW_LIST=false
178+ rm -f allowlist.json
182179 fi
183- export WHITE_LIST ALLOW_LIST
180+ else
181+ ALLOW_LIST=false
182+ rm -f allowlist.json
184183fi
184+ sed -i ' /^white-list=.*/d' server.properties # Removes white-list= line from server.properties
185+ export ALLOW_LIST
185186
186187set-property --file server.properties --bulk /etc/bds-property-definitions.json
187188
You can’t perform that action at this time.
0 commit comments