From 166247c4bf2334b7e0f2967864e329bcbd55abf4 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Sat, 20 Apr 2024 17:08:06 +0200 Subject: [PATCH] Update initialization and server startup code --- entrypoint.sh | 35 ++++++++++------------------------- 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index a9dd4df..78d560f 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -57,10 +57,6 @@ function initialize() { export "MCSD_SAFEMODE=false" fi # MCSD functionality - if [ ! "${MCSD_AUTO_RESTART}" == "true" ] && [ ! "${MCSD_AUTO_RESTART}" == "false" ]; then - echo ":: Warning: No/Invalid value supplied to \$MCSD_AUTO_RESTART, defaulting to false" - export "MCSD_AUTO_RESTART=false" - fi if [ ! "${MCSD_CLEAN_LOGS}" == "true" ] && [ ! "${MCSD_CLEAN_LOGS}" == "false" ]; then echo ":: Warning: No/Invalid value supplied to \$MCSD_CLEAN_LOGS, defaulting to false" export "MCSD_CLEAN_LOGS=false" @@ -162,25 +158,14 @@ function compile_flags() { esac } -# Starts the server -function run() { - echo ":: Starting server" - cd /data||exit 69 - # We want to use ${ARGS} without using parenthesis - # shellcheck disable=SC2086 - exec "/usr/lib/jvm/java-${MCSD_JAVA_VERSION}-openjdk/bin/java" ${FLAGS} -jar "/data/server.jar" ${ARGS} -} +print_banner +initialize +check +accept_eula +clean_logs +compile_args +compile_flags -# Need I say more? -function main() { - print_banner - initialize - check - accept_eula - clean_logs - compile_args - compile_flags - run -} - -main +echo ":: Starting server" +cd /data||exit 69 +exec "/usr/lib/jvm/java-${MCSD_JAVA_VERSION}-openjdk/bin/java" ${FLAGS} -jar "/data/server.jar" ${ARGS}