Add MCSD_CLEAN_LOGS option
This commit is contained in:
parent
6480a6036e
commit
a404cb9395
2 changed files with 8 additions and 2 deletions
|
@ -13,6 +13,7 @@ services:
|
|||
- MCSD_FORCE_UPGRADE=true # updates all chunks to the latest version, if possible. will slow down startup time on upgrade but will significantly increase server performance during runtime
|
||||
- MCSD_SAFEMODE=false # disables all datapacks
|
||||
- MCSD_AUTO_RESTART=true # restarts the server automatically if it exists
|
||||
- MCSD_CLEAN_LOGS=true # removes all log files on startup (restarts are not affected)
|
||||
- MCSD_JAVA_VERSION=17 # available arw: 17, 11 and 8
|
||||
ports:
|
||||
- 25565:25565
|
||||
|
|
|
@ -25,11 +25,15 @@ function initialize() {
|
|||
export "ARGS=${ARGS}--safeMode "
|
||||
fi
|
||||
if [ ! "${MCSD_AUTO_RESTART}" == "true" ] && [ ! "${MCSD_AUTO_RESTART}" == "false" ]; then
|
||||
echo ":: Warning: No/Invalid auto restart value supplied, defaulting to false"
|
||||
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"
|
||||
fi
|
||||
if [ ! "${MCSD_JAVA_VERSION}" == "17" ] && [ ! "${MCSD_JAVA_VERSION}" == "11" ] && [ ! "${MCSD_JAVA_VERSION}" == "8" ]; then
|
||||
echo ":: Warning: No/Invalid java version supplied, defaulting to java version 17"
|
||||
echo ":: Warning: No/Invalid java version supplied to \$MCSD_JAVA_VERSION, defaulting to java version 17"
|
||||
export "MCSD_JAVA_VERSION=17"
|
||||
fi
|
||||
}
|
||||
|
@ -84,6 +88,7 @@ function main() {
|
|||
initialize
|
||||
check
|
||||
accept_eula
|
||||
if [ "${MCSD_CLEAN_LOGS}" == "true" ]; then rm -rf "/data/logs"; fi
|
||||
run
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue