From 796f2fe14a72fc6914ab0a1ae756c9def6a5e13a Mon Sep 17 00:00:00 2001 From: Code Monad Date: Tue, 14 Jul 2020 10:00:46 +0800 Subject: [PATCH] Add support for rcon password from file (#585) --- start-configuration | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/start-configuration b/start-configuration index 1218ca7f..26712e4f 100644 --- a/start-configuration +++ b/start-configuration @@ -45,6 +45,22 @@ if [[ $PROXY ]]; then sleep 5 fi +if [[ $RCON_PASSWORD_FILE ]]; then + log "" + if [ ! -e ${RCON_PASSWORD_FILE} ]; then + log "Initial RCON password file ${RCON_PASSWORD_FILE} does not seems to exist." + log "Please ensure your configuration." + log "If you are using Docker Secrets feature, please check this for further information: " + log " https://docs.docker.com/engine/swarm/secrets" + log "" + exit 1 + else + RCON_PASSWORD=$(cat ${RCON_PASSWORD_FILE}) + export RCON_PASSWORD + fi + log "" +fi + export SERVER_PROPERTIES=/data/server.properties export VERSIONS_JSON=https://launchermeta.mojang.com/mc/game/version_manifest.json