mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-03-21 22:12:44 +00:00
mc: apply INIT/MAX RAM settings into FTB local settings file
fixes #222
This commit is contained in:
@@ -73,8 +73,7 @@ if [[ ${GUI} = false || ${GUI} = FALSE ]]; then
|
||||
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}"
|
||||
echo "Setting initial memory to ${INIT_MEMORY:=${MEMORY}} and max to ${MAX_MEMORY:=${MEMORY}}"
|
||||
|
||||
if [[ ${TYPE} == "FEED-THE-BEAST" ]]; then
|
||||
if [ ! -e ${FTB_DIR}/ops.json -a -e /data/ops.txt ]; then
|
||||
@@ -89,14 +88,20 @@ if [[ ${TYPE} == "FEED-THE-BEAST" ]]; then
|
||||
cp -f /data/eula.txt ${FTB_DIR}/
|
||||
fi
|
||||
|
||||
cat > ${FTB_DIR}/settings-local.sh <<EOF
|
||||
export MIN_RAM="${INIT_MEMORY}"
|
||||
export MAX_RAM="${MAX_MEMORY}"
|
||||
EOF
|
||||
|
||||
cd ${FTB_DIR}
|
||||
echo "Running FTB server modpack start ..."
|
||||
exec mc-server-runner ${FTB_SERVER_START}
|
||||
else
|
||||
# If we have a bootstrap.txt file... feed that in to the server stdin
|
||||
if [ -f /data/bootstrap.txt ]; then
|
||||
bootstrapArgs="--bootstrap /data/bootstrap.txt"
|
||||
fi
|
||||
# If we have a bootstrap.txt file... feed that in to the server stdin
|
||||
if [ -f /data/bootstrap.txt ]; then
|
||||
bootstrapArgs="--bootstrap /data/bootstrap.txt"
|
||||
fi
|
||||
|
||||
exec mc-server-runner ${bootstrapArgs} java $JVM_XX_OPTS $JVM_OPTS -jar $SERVER "$@" $EXTRA_ARGS
|
||||
JVM_OPTS="-Xms${INIT_MEMORY} -Xmx${MAX_MEMORY} ${JVM_OPTS}"
|
||||
exec mc-server-runner ${bootstrapArgs} java $JVM_XX_OPTS $JVM_OPTS -jar $SERVER "$@" $EXTRA_ARGS
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user