From 6a565692a025bd972f2710f05b4e8e04c4f05909 Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Fri, 19 May 2017 19:53:45 -0700 Subject: [PATCH 1/2] Add optional `nogui` If set via ENV, disable GUI on server. --- minecraft-server/start-minecraft.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/minecraft-server/start-minecraft.sh b/minecraft-server/start-minecraft.sh index ac990468..ce46fea5 100755 --- a/minecraft-server/start-minecraft.sh +++ b/minecraft-server/start-minecraft.sh @@ -503,12 +503,17 @@ if [ "$TYPE" = "SPIGOT" ]; then fi fi -if [[ $CONSOLE = false ]]; then - EXTRA_ARGS=--noconsole -else - EXTRA_ARGS="" +EXTRA_ARGS="" +# Optional disable console +if [[ ${CONSOLE} = false ]]; then + EXTRA_ARGS+="--noconsole" fi +# Optional disable GUI for headless servers +if [[ ${GUI} = false ]]; then + EXTRA_ARGS="${EXTRA_ARGS} nogui" +fi + # put these prior JVM_OPTS at the end to give any memory settings there higher precedence echo "Setting initial memory to ${INIT_MEMORY:-${MEMORY}} and max to ${MAX_MEMORY:-${MEMORY}}" JVM_OPTS="-Xms${INIT_MEMORY:-${MEMORY}} -Xmx${MAX_MEMORY:-${MEMORY}} ${JVM_OPTS}" From 1d5c4e3b0b274e52595748fe48304328157d3e1c Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Fri, 19 May 2017 21:32:52 -0700 Subject: [PATCH 2/2] Check both upper and lower arguments --- minecraft-server/start-minecraft.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/minecraft-server/start-minecraft.sh b/minecraft-server/start-minecraft.sh index ce46fea5..1667265c 100755 --- a/minecraft-server/start-minecraft.sh +++ b/minecraft-server/start-minecraft.sh @@ -505,12 +505,12 @@ fi EXTRA_ARGS="" # Optional disable console -if [[ ${CONSOLE} = false ]]; then +if [[ ${CONSOLE} = false || ${CONSOLE} = FALSE ]]; then EXTRA_ARGS+="--noconsole" fi # Optional disable GUI for headless servers -if [[ ${GUI} = false ]]; then +if [[ ${GUI} = false || ${GUI} = FALSE ]]; then EXTRA_ARGS="${EXTRA_ARGS} nogui" fi