Fix issues and update config.example.env

This commit is contained in:
JeremyStar™ 2024-01-27 18:27:59 +01:00
parent b7e43cf437
commit 80a4bc4f14
2 changed files with 40 additions and 8 deletions

View file

@ -1,5 +1,8 @@
# MCServerDocker configuration file # MCServerDocker configuration file
##################
# Server options #
##################
# ENFORCE_FRESH_CACHES # ENFORCE_FRESH_CACHES
## Cleans all caches on startup, useful if you experience issues. ## Cleans all caches on startup, useful if you experience issues.
MCSD_ENFORCE_FRESH_CACHES=false MCSD_ENFORCE_FRESH_CACHES=false
@ -12,17 +15,46 @@ MCSD_FORCE_UPGRADE=true
# Disables all datapacks # Disables all datapacks
MCSD_SAFEMODE=false MCSD_SAFEMODE=false
# AUTO_RESTART #################
## Restarts the server automatically if it exits # MCSD features #
MCSD_AUTO_RESTART=true #################
# CLEAN_LOGS # CLEAN_LOGS
# Removes all log files on startup (restarts are not affected) # Removes all log files on startup (restarts are not affected)
MCSD_CLEAN_LOGS=true MCSD_CLEAN_LOGS=true
# AUTO_RESTART
## Restarts the server automatically if it exits
MCSD_AUTO_RESTART=true
#################
# Memory limits #
#################
# MIN_MEMORY
## The minimum amount of memory Minecraft uses
## Set this to $MCSD_MEMORY_MAX if you want maximum performance
MCSD_MEMORY_MIN=2048M
# MAX_MEMORY
## The maximum amount of memory Minecraft should use
## Note: The java process WILL use more memory than you specify here,
## as the JVM does not include itself in this limit here.
MCSD_MAX_MEMORY=2048M
########
# Java #
########
# JAVA_VERSION # JAVA_VERSION
## Minecraft version | Java version ## Minecraft version | Java version
## <= 1.16 | 8 ## <= 1.16 | 8
## <= 1.16 | 11 (may increase performance) ## <= 1.16 | 11 (may increase performance)
## >= 1.17 | 17 ## >= 1.17 | 17
MCSD_JAVA_VERSION=17 MCSD_JAVA_VERSION=17
# OPTIMIZED_FLAGS
## Applies a modified variant of Aikar's Flags
MCSD_OPTIMIZED_FLAGS=true
# GARBAGECOLLECTOR
## Configures the garbage collector
## Supported are: G1GC, ZGC
MCSD_GARBAGECOLLECTOR=G1GC

View file

@ -66,11 +66,11 @@ function initialize() {
export "MCSD_CLEAN_LOGS=false" export "MCSD_CLEAN_LOGS=false"
fi fi
# Memory limits # Memory limits
if [ -n "${MCSD_MEMORY_MIN}" ]; then if [ -z "${MCSD_MEMORY_MIN}" ]; then
echo ":: Error: No memory limit supplied to \$MCSD_MEMORY_MIN" echo ":: Error: No memory limit supplied to \$MCSD_MEMORY_MIN"
exit 1 exit 1
fi fi
if [ -n "${MCSD_MEMORY_MAX}" ]; then if [ -z "${MCSD_MEMORY_MAX}" ]; then
echo ":: Error: No memory limit supplied to \$MCSD_MEMORY_MAX" echo ":: Error: No memory limit supplied to \$MCSD_MEMORY_MAX"
exit 1 exit 1
fi fi
@ -191,7 +191,7 @@ function main() {
run run
# Restart server if enabled # Restart server if enabled
if [ "${SHUTDOWN}" == "true" ]; then if [ "${SHUTDOWN}" == "true" ]; then
echo ":: Ending execution" echo ":: Ending execution (SHUTDOWN=true)"
exit 0 exit 0
fi fi
case "${MCSD_AUTO_RESTART}" in case "${MCSD_AUTO_RESTART}" in
@ -200,7 +200,7 @@ function main() {
run run
;; ;;
"false") "false")
echo ":: Ending execution" echo ":: Ending execution (MCSD_AUTO_RESTART=false)"
exit 0 exit 0
;; ;;
*) *)