From 38da08b9eb6732b892da90480cc25c1e1d3e1c37 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Sat, 20 Apr 2024 17:14:51 +0200 Subject: [PATCH] Allow for custom arguments --- config.example.env | 7 +++++++ entrypoint.sh | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/config.example.env b/config.example.env index f5f9df3..f23faa2 100644 --- a/config.example.env +++ b/config.example.env @@ -54,3 +54,10 @@ MCSD_OPTIMIZED_FLAGS=true ## Configures the garbage collector ## Supported are: G1GC, ZGC MCSD_GARBAGECOLLECTOR=G1GC + +# CUSTOM_ARGS +## Allows you to configure custom +## arguments that will be passed to +## the Java virtual machine. +## Leave empty to disable. +MCSD_CUSTOM_ARGS="" diff --git a/entrypoint.sh b/entrypoint.sh index 78d560f..62c7746 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -168,4 +168,8 @@ compile_flags echo ":: Starting server" cd /data||exit 69 -exec "/usr/lib/jvm/java-${MCSD_JAVA_VERSION}-openjdk/bin/java" ${FLAGS} -jar "/data/server.jar" ${ARGS} +if [ -z "${MCSD_CUSTOM_ARGS}" ]; then + exec "/usr/lib/jvm/java-${MCSD_JAVA_VERSION}-openjdk/bin/java" ${FLAGS} -jar "/data/server.jar" ${ARGS} +else + exec "/usr/lib/jvm/java-${MCSD_JAVA_VERSION}-openjdk/bin/java" ${MCSD_CUSTOM_ARGS} +fi