diff --git a/README.md b/README.md index cd598dc4..66808883 100644 --- a/README.md +++ b/README.md @@ -753,12 +753,18 @@ To whitelist players for your Minecraft server, pass the Minecraft usernames sep If the `WHITELIST` environment variable is not used, any user can join your Minecraft server if it's publicly accessible. +> NOTE: When `WHITELIST` is used the server property `white-list` will automatically get set to `true`. + +> By default, the players in `WHITELIST` are **added** to the final `whitelist.json` file by the Minecraft server. If you set `OVERRIDE_WHITELIST` to "true" then the `whitelist.json` file will be recreated on each server startup. + ### Op/Administrator Players To add more "op" (aka adminstrator) users to your Minecraft server, pass the Minecraft usernames separated by commas via the `OPS` environment variable, such as docker run -d -e OPS=user1,user2 ... +> By default, the players in `OPS` are **added** to the final `ops.json` file by the Minecraft server. If you set `OVERRIDE_OPS` to "true" then the `ops.json` file will be recreated on each server startup. + ### Server icon A server icon can be configured using the `ICON` variable. The image will be automatically diff --git a/start-minecraftFinalSetup b/start-minecraftFinalSetup index 812a9bb0..4ee8b71c 100644 --- a/start-minecraftFinalSetup +++ b/start-minecraftFinalSetup @@ -3,15 +3,25 @@ . ${SCRIPTS:-/}start-utils if [ -n "$OPS" ]; then - log "Setting/adding ops" - rm -rf /data/ops.txt.converted + log "Updating ops" + rm -f /data/ops.txt.converted echo $OPS | awk -v RS=, '{print}' > /data/ops.txt + + if isTrue "${OVERRIDE_OPS}"; then + log "Recreating ops.json file at server startup" + rm -f /data/ops.json + fi fi if [ -n "$WHITELIST" ]; then - log "Setting whitelist" - rm -rf /data/white-list.txt.converted + log "Updating whitelist" + rm -f /data/white-list.txt.converted echo $WHITELIST | awk -v RS=, '{print}' > /data/white-list.txt + + if isTrue "${OVERRIDE_WHITELIST}"; then + log "Recreating whitelist.json file at server startup" + rm -f /data/whitelist.json + fi fi if [ -n "$ICON" ]; then