Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions scripts/start-finalExec
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

: "${DEBUG_EXEC:=false}"
: "${SETUP_ONLY:=false}"

# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
isDebugging && set -x
Expand Down Expand Up @@ -234,7 +237,7 @@ if [[ ${TYPE} == "CURSEFORGE" && "${SERVER}" ]]; then

cd "${FTB_DIR}" || (log "ERROR: can't go into ${FTB_DIR}"; exit 1)
log "Starting CurseForge server in ${FTB_DIR}..."
if isTrue ${DEBUG_EXEC}; then
if isTrue "${DEBUG_EXEC}"; then
set -x
fi
exec mc-server-runner ${bootstrapArgs} "${mcServerRunnerArgs[@]}" java $JVM_XX_OPTS $JVM_OPTS $expandedDOpts -jar "$(basename "${SERVER}")" "$@" $EXTRA_ARGS
Expand All @@ -259,23 +262,23 @@ EOF

finalArgs="${FTB_SERVER_START}"

if isTrue "${SETUP_ONLY:=false}"; then
if isTrue "${SETUP_ONLY}"; then
echo "SETUP_ONLY: ${finalArgs}"
exit
fi

if isTrue ${DEBUG_EXEC}; then
if isTrue "${DEBUG_EXEC}"; then
set -x
fi
if isTrue ${EXEC_DIRECTLY:-false}; then
if isTrue "${EXEC_DIRECTLY:-false}"; then
"${finalArgs[@]}"
else
exec mc-server-runner "${mcServerRunnerArgs[@]}" "${finalArgs[@]}"
fi
elif [[ $SERVER =~ run.sh ]]; then
log "Using Forge supplied run.sh script..."
echo $JVM_XX_OPTS $JVM_OPTS $expandedDOpts > user_jvm_args.txt
if isTrue ${SETUP_ONLY:=false}; then
if isTrue ${SETUP_ONLY}; then
echo "SETUP_ONLY: bash ${SERVER}"
exit
fi
Expand All @@ -296,7 +299,7 @@ else
"$@" $EXTRA_ARGS
)

if isTrue ${SETUP_ONLY:=false}; then
if isTrue ${SETUP_ONLY}; then
echo "SETUP_ONLY: java ${finalArgs[*]}"
exit
fi
Expand Down
6 changes: 2 additions & 4 deletions scripts/start-utils
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ function getFilenameFromUrl() {
}

function isTrue() {
local arg="${1?}"
case ${arg,,} in
case "${1,,}" in
true | on | 1)
return 0
;;
Expand All @@ -75,8 +74,7 @@ function isTrue() {
}

function isFalse() {
local arg="${1?}"
case ${arg,,} in
case "${1,,}" in
false | off | 0)
return 0
;;
Expand Down