Improve local development (#3661)

This commit is contained in:
Geoff Bourne
2025-09-19 15:07:35 -05:00
committed by GitHub
parent 9cbe5c2228
commit 81cbc72ae9
55 changed files with 161 additions and 147 deletions

View File

@@ -0,0 +1,143 @@
#!/bin/bash
. "$(dirname "$0")/autopause-fcns.sh"
# shellcheck source=../start-utils
. "$(dirname "$0")/../start-utils"
if isTrue "${DEBUG_AUTOPAUSE}"; then
set -x
fi
autopause_error_loop() {
logAutopause "Available interfaces within the docker container:"
logAutopause " $(mc-image-helper network-interfaces)"
logAutopause "Please set the environment variable AUTOPAUSE_KNOCK_INTERFACE to the interface that handles incoming connections."
logAutopause "If unsure which interface to choose, run the ifconfig command in the container."
logAutopause "Autopause failed to initialize. This log entry will be printed every 30 minutes."
while :
do
sleep 1800
logAutopause "Autopause failed to initialize."
done
}
# wait for java process to be started
while :
do
if java_process_exists ; then
break
fi
sleep 0.1
done
# check for interface existence
if [[ -z "$AUTOPAUSE_KNOCK_INTERFACE" ]] ; then
logAutopause "AUTOPAUSE_KNOCK_INTERFACE variable must not be empty!"
autopause_error_loop
fi
if ! mc-image-helper network-interfaces --check="$AUTOPAUSE_KNOCK_INTERFACE" ; then
logAutopause "Selected interface \"$AUTOPAUSE_KNOCK_INTERFACE\" does not exist!"
autopause_error_loop
fi
knockdArgs=(-c /tmp/knockd-config.cfg -d -i "$AUTOPAUSE_KNOCK_INTERFACE")
if isTrue "${DEBUG_AUTOPAUSE}"; then
knockdArgs+=(-D)
fi
/usr/local/sbin/knockd "${knockdArgs[@]}"
if [ $? -ne 0 ] ; then
logAutopause "Failed to start knockd daemon."
logAutopause "Probable cause: Unable to attach to interface \"$AUTOPAUSE_KNOCK_INTERFACE\"."
autopause_error_loop
fi
STATE=INIT
while :
do
isTrue "${DEBUG_AUTOPAUSE}" && log "DEBUG: autopause state = $STATE"
case X$STATE in
XINIT)
# Server startup
if mc_server_listening ; then
TIME_THRESH=$(($(current_uptime)+$AUTOPAUSE_TIMEOUT_INIT))
if [ -e /data/.skip-pause ] ; then
logAutopause "'/data/.skip-pause' file is present - skipping pausing"
else
logAutopause "MC Server listening for connections - pausing in $AUTOPAUSE_TIMEOUT_INIT seconds"
fi
STATE=K
fi
;;
XK)
# Knocked
if java_clients_connected ; then
logAutopause "Client connected - waiting for disconnect"
STATE=E
elif [ -e /data/.skip-pause ] ; then
logAutopause "'/data/.skip-pause' file is present - skipping pausing"
STATE=E
else
if [[ $(current_uptime) -ge $TIME_THRESH ]] ; then
logAutopause "No client connected since startup / knocked - pausing"
"$(dirname "$0")/pause.sh"
STATE=S
fi
fi
;;
XE)
# Established
if ! java_clients_connected ; then
TIME_THRESH=$(($(current_uptime)+$AUTOPAUSE_TIMEOUT_EST))
logAutopause "All clients disconnected - pausing in $AUTOPAUSE_TIMEOUT_EST seconds"
STATE=I
fi
;;
XI)
# Idle
if java_clients_connected ; then
logAutopause "Client reconnected - waiting for disconnect"
STATE=E
elif [ -e /data/.skip-pause ] ; then
TIME_THRESH=$(($(current_uptime)+$AUTOPAUSE_TIMEOUT_EST))
logAutopause "'/data/.skip-pause' file is present - skipping pausing"
STATE=E
else
if [[ $(current_uptime) -ge $TIME_THRESH ]] ; then
logAutopause "No client reconnected - pausing"
"$(dirname "$0")/pause.sh"
STATE=S
fi
fi
;;
XS)
# Stopped
if rcon_client_exists ; then
"$(dirname "$0")/resume.sh"
fi
if java_running ; then
if java_clients_connected ; then
logAutopause "Client connected - waiting for disconnect"
STATE=E
else
TIME_THRESH=$(($(current_uptime)+$AUTOPAUSE_TIMEOUT_KN))
logAutopause "Server was knocked - waiting for clients or timeout"
STATE=K
fi
fi
;;
*)
logAutopause "Error: invalid state: $STATE"
;;
esac
if [[ "$STATE" == "S" ]] ; then
# before rcon times out
sleep 5
else
sleep "$AUTOPAUSE_PERIOD"
fi
done

View File

@@ -0,0 +1,64 @@
#!/bin/bash
# shellcheck source=../scripts/start-utils
. "$(dirname "$0")/../start-utils"
current_uptime() {
awk '{print $1}' /proc/uptime | cut -d . -f 1
}
java_running() {
[[ $( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]]
}
java_process_exists() {
[[ -n "$(ps -ax -o comm | grep 'java')" ]]
}
rcon_client_exists() {
[[ -n "$(ps -ax -o comm | grep 'rcon-cli')" ]]
}
use_proxy() {
if isTrue "$USES_PROXY_PROTOCOL"; then
echo "--use-proxy"
fi
}
use_server_list_ping() {
if [[ "${VERSION^^}" == "LATEST" || "${VERSION^^}" == "SNAPSHOT" ]]; then
# Don't use server-list ping for unknown version
return 1
fi
if versionLessThan 1.7; then
echo "--use-server-list-ping"
fi
}
mc_server_listening() {
mc-monitor status $(use_proxy) --host "${SERVER_HOST:-localhost}" --port "$SERVER_PORT" $(use_server_list_ping) --timeout 10s >&/dev/null
}
java_clients_connections() {
local connections
if java_running; then
if ! connections=$(mc-monitor status \
--host "${SERVER_HOST:-localhost}" \
--port "$SERVER_PORT" \
--retry-limit "${AUTOPAUSE_STATUS_RETRY_LIMIT:-10}" --retry-interval "${AUTOPAUSE_STATUS_RETRY_INTERVAL:-2s}" \
$(use_proxy) $(use_server_list_ping) \
--show-player-count); then
# consider it a non-zero player count if the ping fails
# otherwise a laggy server with players connected could get paused
connections=1
fi
else
connections=0
fi
echo $connections
}
java_clients_connected() {
(( $(java_clients_connections) > 0 ))
}

View File

@@ -0,0 +1,87 @@
#!/bin/bash
# needed for the clients connected function residing in autopause
. "$(dirname "$0")/autopause-fcns.sh"
# shellcheck source=../../scripts/start-utils
. "$(dirname "$0")/../start-utils"
if isTrue "${DEBUG_AUTOSTOP}"; then
set -x
fi
# wait for java process to be started
while :
do
if java_process_exists ; then
break
fi
sleep 0.1
done
STATE=INIT
while :
do
isTrue "${DEBUG_AUTOSTOP}" && log "DEBUG: autostop state = $STATE"
case X$STATE in
XINIT)
# Server startup
if mc_server_listening ; then
TIME_THRESH=$(($(current_uptime)+AUTOSTOP_TIMEOUT_INIT))
if [ -e /data/.skip-stop ] ; then
logAutostop "'/data/.skip-stop' file is present - skipping stopping"
else
logAutostop "MC Server listening for connections - stopping in $AUTOSTOP_TIMEOUT_INIT seconds"
fi
STATE=II
fi
;;
XII)
# Initial idle
if java_clients_connected ; then
logAutostop "Client connected - waiting for disconnect"
STATE=E
elif [ -e /data/.skip-stop ] ; then
logAutostop "'/data/.skip-stop' file is present - skipping stopping"
STATE=E
else
if [[ $(current_uptime) -ge $TIME_THRESH ]] ; then
logAutostop "No client connected since startup - stopping server"
/auto/stop.sh
exit 0
fi
fi
;;
XE)
# Established
if ! java_clients_connected ; then
TIME_THRESH=$(($(current_uptime)+$AUTOSTOP_TIMEOUT_EST))
logAutostop "All clients disconnected - stopping in $AUTOSTOP_TIMEOUT_EST seconds"
STATE=I
fi
;;
XI)
# Idle
if java_clients_connected ; then
logAutostop "Client reconnected - waiting for disconnect"
STATE=E
elif [ -e /data/.skip-stop ] ; then
TIME_THRESH=$(($(current_uptime)+$AUTOSTOP_TIMEOUT_EST))
logAutostop "'/data/.skip-stop' file is present - skipping stopping"
STATE=E
else
if [[ $(current_uptime) -ge $TIME_THRESH ]] ; then
logAutostop "No client reconnected - stopping"
/auto/stop.sh
exit 0
fi
fi
;;
*)
logAutostop "Error: invalid state: $STATE"
;;
esac
sleep $AUTOSTOP_PERIOD
done

27
scripts/auto/pause.sh Normal file
View File

@@ -0,0 +1,27 @@
#!/bin/bash
. "$(dirname "$0")/../start-utils"
if isTrue "${DEBUG_AUTOPAUSE}"; then
set -x
fi
if [[ $( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]] ; then
# save world
rcon-cli save-all >/dev/null
# wait until mc-monitor is no longer connected to the server
while :
do
if [[ -z "$(netstat -nt | grep "127.0.0.1:$SERVER_PORT" | grep 'ESTABLISHED')" ]]; then
break
fi
sleep 0.1
done
# finally pause the process
logAutopauseAction "Pausing Java process"
pkill -STOP java
# create .paused file in data directory
touch /data/.paused
fi

13
scripts/auto/resume.sh Normal file
View File

@@ -0,0 +1,13 @@
#!/bin/bash
. "$(dirname "$0")/../start-utils"
if isTrue "${DEBUG_AUTOPAUSE}"; then
set -x
fi
if [[ $( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^T.*$ ]] ; then
pkill -CONT java
# remove .paused file from data directory
rm -f /data/.paused
fi

10
scripts/auto/stop.sh Normal file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
. "$(dirname "$0")/../start-utils"
if isTrue "${DEBUG_AUTOSTOP}"; then
set -x
fi
logAutostopAction "Stopping Java process"
pkill -f --signal SIGTERM mc-server-runner

View File

@@ -1,7 +1,7 @@
#!/bin/bash
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
. "$(dirname "$0")/start-utils"
# The Dockerfile ENVs take precedence here, but defaulting for testing consistency
: "${UID:=1000}"
@@ -48,7 +48,7 @@ if ! isTrue "${SKIP_SUDO:-false}" && [ "$(id -u)" = 0 ]; then
echo 'hosts: files dns' > /etc/nsswitch.conf
fi
exec $(getSudoFromDistro) ${runAsUser}:${runAsGroup} "${SCRIPTS:-/}start-configuration" "$@"
exec $(getSudoFromDistro) ${runAsUser}:${runAsGroup} "$(dirname "$0")/start-configuration" "$@"
else
exec "${SCRIPTS:-/}start-configuration" "$@"
exec "$(dirname "$0")/start-configuration" "$@"
fi

View File

@@ -1,7 +1,7 @@
#!/bin/bash
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
. "$(dirname "$0")/start-utils"
: "${SERVER_PORT:=25565}"
: "${ENABLE_AUTOPAUSE:=false}"
@@ -24,7 +24,7 @@ log "Autopause functionality enabled"
isDebugging && set -x
cp /auto/knockd-config.cfg /tmp/knockd-config.cfg
cp /image/knockd-config.cfg /tmp/knockd-config.cfg
function updatePort() {
regseq="^\s*sequence\s*=\s*$1\s*$"
@@ -69,4 +69,4 @@ fi
let COOLDOWN=$AUTOPAUSE_TIMEOUT_KN/2
sed -i "s/\(seq_cooldown *= *\).*/\1$COOLDOWN/" /tmp/knockd-config.cfg
/auto/autopause-daemon.sh &
"$(dirname "$0")/auto/autopause-daemon.sh" &

View File

@@ -1,7 +1,7 @@
#!/bin/bash
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
. "$(dirname "$0")/start-utils"
: "${SERVER_PORT:=25565}"
: "${ENABLE_AUTOSTOP:=false}"

View File

@@ -3,7 +3,7 @@ set -euo pipefail
IFS=$'\n\t'
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
. "$(dirname "$0")/start-utils"
: "${EULA:=}"
: "${PROXY:=}"
@@ -166,11 +166,11 @@ if isTrue "${VERSION_FROM_MODRINTH_PROJECTS:-}" && [[ ${MODRINTH_PROJECTS:-} ]];
fi
if isTrue "${ENABLE_AUTOPAUSE}"; then
"${SCRIPTS:-/}start-autopause"
"$(dirname "$0")/start-autopause"
fi
if isTrue "${ENABLE_AUTOSTOP}"; then
"${SCRIPTS:-/}start-autostop"
"$(dirname "$0")/start-autostop"
fi
if
@@ -182,7 +182,7 @@ if
then
log "Starting RCON commands"
# shellcheck source=start-rconcmds
"${SCRIPTS:-/}start-rconcmds"
"$(dirname "$0")/start-rconcmds"
fi
: "${MODPACK_PLATFORM:=${MOD_PLATFORM:-}}"
@@ -200,19 +200,19 @@ esac
if [[ $MODPACK_PLATFORM ]]; then
case "${MODPACK_PLATFORM^^}" in
FTB|CURSEFORGE)
exec "${SCRIPTS:-/}start-deployCF" "$@"
exec "$(dirname "$0")/start-deployCF" "$@"
;;
FTBA)
exec "${SCRIPTS:-/}start-deployFTBA" "$@"
exec "$(dirname "$0")/start-deployFTBA" "$@"
;;
AUTO_CURSEFORGE)
exec "${SCRIPTS:-/}start-deployAutoCF" "$@"
exec "$(dirname "$0")/start-deployAutoCF" "$@"
;;
MODRINTH)
exec "${SCRIPTS:-/}start-deployModrinth" "$@"
exec "$(dirname "$0")/start-deployModrinth" "$@"
;;
*)
@@ -225,99 +225,99 @@ fi
log "Resolving type given ${TYPE}"
case "${TYPE^^}" in
*BUKKIT|SPIGOT)
exec "${SCRIPTS:-/}start-deployBukkitSpigot" "$@"
exec "$(dirname "$0")/start-deployBukkitSpigot" "$@"
;;
PAPER)
exec "${SCRIPTS:-/}start-deployPaper" "$@"
exec "$(dirname "$0")/start-deployPaper" "$@"
;;
FOLIA)
exec "${SCRIPTS:-/}start-deployFolia" "$@"
exec "$(dirname "$0")/start-deployFolia" "$@"
;;
FORGE)
exec "${SCRIPTS:-/}start-deployForge" "$@"
exec "$(dirname "$0")/start-deployForge" "$@"
;;
NEOFORGE|NEOFORGED)
exec "${SCRIPTS:-/}start-deployNeoForge" "$@"
exec "$(dirname "$0")/start-deployNeoForge" "$@"
;;
FABRIC)
exec "${SCRIPTS:-/}start-deployFabric" "$@"
exec "$(dirname "$0")/start-deployFabric" "$@"
;;
QUILT)
exec "${SCRIPTS:-/}start-deployQuilt" "$@"
exec "$(dirname "$0")/start-deployQuilt" "$@"
;;
VANILLA)
exec "${SCRIPTS:-/}start-deployVanilla" "$@"
exec "$(dirname "$0")/start-deployVanilla" "$@"
;;
SPONGEVANILLA)
exec "${SCRIPTS:-/}start-deploySpongeVanilla" "$@"
exec "$(dirname "$0")/start-deploySpongeVanilla" "$@"
;;
CUSTOM)
exec "${SCRIPTS:-/}start-deployCustom" "$@"
exec "$(dirname "$0")/start-deployCustom" "$@"
;;
MAGMA)
exec "${SCRIPTS:-/}start-deployMagma" "$@"
exec "$(dirname "$0")/start-deployMagma" "$@"
;;
MAGMA_MAINTAINED)
exec "${SCRIPTS:-/}start-deployMagmaMaintained" "$@"
exec "$(dirname "$0")/start-deployMagmaMaintained" "$@"
;;
KETTING)
exec "${SCRIPTS:-/}start-deployKetting" "$@"
exec "$(dirname "$0")/start-deployKetting" "$@"
;;
MOHIST|YOUER|BANNER)
exec "${SCRIPTS:-/}start-deployMohist" "$@"
exec "$(dirname "$0")/start-deployMohist" "$@"
;;
CATSERVER)
exec "${SCRIPTS:-/}start-deployCatserver" "$@"
exec "$(dirname "$0")/start-deployCatserver" "$@"
;;
PURPUR)
exec "${SCRIPTS:-/}start-deployPurpur" "$@"
exec "$(dirname "$0")/start-deployPurpur" "$@"
;;
PUFFERFISH)
exec "${SCRIPTS:-/}start-deployPufferfish" "$@"
exec "$(dirname "$0")/start-deployPufferfish" "$@"
;;
CANYON)
exec "${SCRIPTS:-/}start-deployCanyon" "$@"
exec "$(dirname "$0")/start-deployCanyon" "$@"
;;
LIMBO)
exec "${SCRIPTS:-/}start-deployLimbo" "$@"
exec "$(dirname "$0")/start-deployLimbo" "$@"
;;
NANOLIMBO)
exec "${SCRIPTS:-/}start-deployNanoLimbo" "$@"
exec "$(dirname "$0")/start-deployNanoLimbo" "$@"
;;
CRUCIBLE)
exec "${SCRIPTS:-/}start-deployCrucible" "$@"
exec "$(dirname "$0")/start-deployCrucible" "$@"
;;
LEAF)
exec "${SCRIPTS:-/}start-deployLeaf" "$@"
exec "$(dirname "$0")/start-deployLeaf" "$@"
;;
ARCLIGHT)
exec "${SCRIPTS:-/}start-deployArcLight" "$@"
exec "$(dirname "$0")/start-deployArcLight" "$@"
;;
POSEIDON)
exec "${SCRIPTS:-/}start-deployPoseidon" "$@"
exec "$(dirname "$0")/start-deployPoseidon" "$@"
;;
*)

View File

@@ -38,4 +38,4 @@ export SERVER
export FAMILY=HYBRID
export HYBRIDTYPE="${ARCLIGHT_TYPE,,}"
exec "${SCRIPTS:-/}start-spiget" "$@"
exec "$(dirname "$0")/start-spiget" "$@"

View File

@@ -2,7 +2,7 @@
set -eu
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
. "$(dirname "$0")/start-utils"
: "${CF_PAGE_URL:=}"
: "${CF_SLUG:=}"
@@ -75,4 +75,4 @@ fi
applyResultsFile ${resultsFile}
resolveFamily
exec "${SCRIPTS:-/}start-setupWorld" "$@"
exec "$(dirname "$0")/start-setupWorld" "$@"

View File

@@ -1,7 +1,7 @@
#!/bin/bash
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
. "$(dirname "$0")/start-utils"
isDebugging && set -x
set -eo pipefail
@@ -123,4 +123,4 @@ export JVM_OPTS
# Normalize on Spigot for operations below
export FAMILY=SPIGOT
exec "${SCRIPTS:-/}start-spiget" "$@"
exec "$(dirname "$0")/start-spiget" "$@"

View File

@@ -3,7 +3,7 @@
set -e
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
. "$(dirname "$0")/start-utils"
loadForgeVars() {
cfgFile=${1?}
@@ -138,7 +138,7 @@ if ! isTrue "${USE_MODPACK_START_SCRIPT:-true}"; then
FTB_DIR=$(dirname "${SERVER}")
export FTB_DIR
exec "${SCRIPTS:-/}start-setupWorld" "$@"
exec "$(dirname "$0")/start-setupWorld" "$@"
fi
@@ -250,4 +250,4 @@ if isTrue "${FTB_LEGACYJAVAFIXER}" && [ ! -e "${legacyJavaFixerPath}" ]; then
fi
export FAMILY=FORGE
exec "${SCRIPTS:-/}start-setupWorld" "$@"
exec "$(dirname "$0")/start-setupWorld" "$@"

View File

@@ -3,7 +3,7 @@ set -euo pipefail
IFS=$'\n\t'
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
. "$(dirname "$0")/start-utils"
isDebugging && set -x
: "${CANYON_BUILD:=lastSuccessfulBuild}"
@@ -58,4 +58,4 @@ fi
# Normalize on Spigot for later operations
export FAMILY=SPIGOT
exec ${SCRIPTS:-/}start-spiget "$@"
exec "$(dirname "$0")/start-spiget" "$@"

View File

@@ -1,7 +1,7 @@
#!/bin/bash
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
. "$(dirname "$0")/start-utils"
set -o pipefail
set -e
@@ -30,4 +30,4 @@ fi
export FAMILY=HYBRID
export HYBRIDTYPE=forge
exec "${SCRIPTS:-/}start-spiget" "$@"
exec "$(dirname "$0")/start-spiget" "$@"

View File

@@ -58,4 +58,4 @@ export SERVER
export FAMILY=HYBRID
export HYBRIDTYPE=forge
exec "${SCRIPTS:-/}start-spiget" "$@"
exec "$(dirname "$0")/start-spiget" "$@"

View File

@@ -5,7 +5,7 @@
: "${CUSTOM_JAR_EXEC:=}"
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
. "$(dirname "$0")/start-utils"
isDebugging && set -x
if isURL "${CUSTOM_SERVER}"; then
@@ -42,4 +42,4 @@ fi
export FAMILY="${FAMILY:-HYBRID}"
export HYBRIDTYPE="${HYBRIDTYPE:-any}"
exec "${SCRIPTS:-/}start-spiget" "$@"
exec "$(dirname "$0")/start-spiget" "$@"

View File

@@ -7,7 +7,7 @@
ftbInstallMarker=".ftb-installed"
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
. "$(dirname "$0")/start-utils"
isDebugging && set -x
set -e
@@ -160,4 +160,4 @@ else
exit 1
fi
exec "${SCRIPTS:-/}start-setupWorld" "$@"
exec "$(dirname "$0")/start-setupWorld" "$@"

View File

@@ -2,7 +2,7 @@
set -eu
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
. "$(dirname "$0")/start-utils"
export TYPE=FABRIC
: "${FABRIC_LAUNCHER_VERSION:=${FABRIC_INSTALLER_VERSION:-LATEST}}"
@@ -56,4 +56,4 @@ fi
applyResultsFile ${resultsFile}
export FAMILY=FABRIC
exec "${SCRIPTS:-/}start-setupWorld" "$@"
exec "$(dirname "$0")/start-setupWorld" "$@"

View File

@@ -3,7 +3,7 @@
: "${FOLIA_CHANNEL:=experimental}"
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
. "$(dirname "$0")/start-utils"
set -o pipefail
handleDebugMode
@@ -18,4 +18,4 @@ fi
PAPER_PROJECT="folia" \
PAPER_NAME="FoliaMC" \
PAPER_CHANNEL="${FOLIA_CHANNEL}" \
exec "${SCRIPTS:-/}start-deployPaper" "$@"
exec "$(dirname "$0")/start-deployPaper" "$@"

View File

@@ -46,4 +46,4 @@ applyResultsFile ${resultsFile}
export FAMILY=FORGE
exec "${SCRIPTS:-/}start-setupWorld" "$@"
exec "$(dirname "$0")/start-setupWorld" "$@"

View File

@@ -1,7 +1,7 @@
#!/bin/bash
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
. "$(dirname "$0")/start-utils"
isDebugging && set -x
if ! SERVER=$(mc-image-helper github download-latest-asset \
@@ -30,4 +30,4 @@ export SERVER
export FAMILY=HYBRID
export HYBRIDTYPE=forge
exec "${SCRIPTS:-/}start-spiget" "$@"
exec "$(dirname "$0")/start-spiget" "$@"

View File

@@ -48,4 +48,4 @@ fi
export FAMILY=SPIGOT
export SERVER
exec "${SCRIPTS:-/}start-spiget" "$@"
exec "$(dirname "$0")/start-spiget" "$@"

View File

@@ -2,15 +2,15 @@
set -euo pipefail
IFS=$'\n\t'
. ${SCRIPTS:-/}start-utils
. "$(dirname "$0")/start-utils"
isDebugging && set -x
: ${LIMBO_BUILD:=LATEST}
: ${FORCE_REDOWNLOAD:=false}
: ${LIMBO_SCHEMA_FILENAME:=default.schem}
: ${LEVEL:=default;${LIMBO_SCHEMA_FILENAME}}
: "${LIMBO_BUILD:=LATEST}"
: "${FORCE_REDOWNLOAD:=false}"
: "${LIMBO_SCHEMA_FILENAME:=default.schem}"
: "${LEVEL:=default;${LIMBO_SCHEMA_FILENAME}}"
# defaults to localhost, if this is not set
: ${SERVER_IP:=0.0.0.0}
: "${SERVER_IP:=0.0.0.0}"
export LEVEL SERVER_IP
@@ -65,4 +65,4 @@ fi
export LEVEL
export FAMILY=LIMBO
exec ${SCRIPTS:-/}start-setupWorld "$@"
exec "$(dirname "$0")/start-setupWorld" "$@"

View File

@@ -1,7 +1,7 @@
#!/bin/bash
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
. "$(dirname "$0")/start-utils"
isDebugging && set -x
: "${MAGMA_VERSION:=}"
@@ -27,4 +27,4 @@ export SERVER
export FAMILY=HYBRID
export HYBRIDTYPE=forge
exec "${SCRIPTS:-/}start-spiget" "$@"
exec "$(dirname "$0")/start-spiget" "$@"

View File

@@ -1,7 +1,7 @@
#!/bin/bash
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
. "$(dirname "$0")/start-utils"
isDebugging && set -x
: "${FORGE_VERSION:=}"
@@ -36,4 +36,4 @@ export SERVER
export FAMILY=HYBRID
export HYBRIDTYPE=forge
exec "${SCRIPTS:-/}start-spiget" "$@"
exec "$(dirname "$0")/start-spiget" "$@"

View File

@@ -2,7 +2,7 @@
set -eu
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
. "$(dirname "$0")/start-utils"
resultsFile=/data/.install-modrinth.env
@@ -75,4 +75,4 @@ fi
applyResultsFile ${resultsFile}
resolveFamily
exec "${SCRIPTS:-/}start-setupWorld" "$@"
exec "$(dirname "$0")/start-setupWorld" "$@"

View File

@@ -62,4 +62,4 @@ fi
export SERVER
export FAMILY=HYBRID
exec "${SCRIPTS:-/}start-spiget" "$@"
exec "$(dirname "$0")/start-spiget" "$@"

View File

@@ -1,7 +1,7 @@
#!/bin/bash
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
. "$(dirname "$0")/start-utils"
isDebugging && set -x
if ! SERVER=$(mc-image-helper github download-latest-asset \
@@ -16,4 +16,4 @@ fi
export SERVER
export FAMILY=LIMBO
exec ${SCRIPTS:-/}start-setupMounts "$@"
exec $(dirname "$0")/start-setupMounts "$@"

View File

@@ -23,4 +23,4 @@ applyResultsFile ${resultsFile}
export FAMILY=FORGE
exec "${SCRIPTS:-/}start-setupWorld" "$@"
exec "$(dirname "$0")/start-setupWorld" "$@"

View File

@@ -1,7 +1,7 @@
#!/bin/bash
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
. "$(dirname "$0")/start-utils"
set -o pipefail
handleDebugMode
@@ -58,4 +58,4 @@ export DOWNLOAD_DEFAULTS
# Normalize on Spigot for downstream operations
export FAMILY=SPIGOT
exec "${SCRIPTS:-/}start-spiget" "$@"
exec "$(dirname "$0")/start-spiget" "$@"

View File

@@ -34,4 +34,4 @@ fi
export SERVER
export FAMILY=SPIGOT
exec "${SCRIPTS:-/}start-spiget" "$@"
exec "$(dirname "$0")/start-spiget" "$@"

View File

@@ -1,7 +1,7 @@
#!/bin/bash
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
. "$(dirname "$0")/start-utils"
set -euo pipefail
isDebugging && set -x
@@ -45,4 +45,4 @@ fi
# Normalize on Spigot for later operations
export FAMILY=SPIGOT
exec "${SCRIPTS:-/}start-spiget" "$@"
exec "$(dirname "$0")/start-spiget" "$@"

View File

@@ -6,7 +6,7 @@ IFS=$'\n\t'
: "${PURPUR_DOWNLOAD_URL:=}"
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
. "$(dirname "$0")/start-utils"
isDebugging && set -x
resultsFile=/data/.purpur.env
@@ -39,4 +39,4 @@ applyResultsFile ${resultsFile}
# Normalize on Spigot for later operations
export FAMILY=SPIGOT
exec "${SCRIPTS:-/}start-spiget" "$@"
exec "$(dirname "$0")/start-spiget" "$@"

View File

@@ -2,7 +2,7 @@
set -eu
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
. "$(dirname "$0")/start-utils"
: "${QUILT_LAUNCHER:=}"
: "${QUILT_LAUNCHER_URL:=}"
@@ -29,7 +29,7 @@ if [[ $QUILT_LAUNCHER ]]; then
resolveVersion
export FAMILY=FABRIC
exec "${SCRIPTS:-/}start-setupWorld" "$@"
exec "$(dirname "$0")/start-setupWorld" "$@"
elif [[ $QUILT_LAUNCHER_URL ]]; then
logError "QUILT_LAUNCHER_URL is not longer supported. Pre-download and use QUILT_LAUNCHER."
@@ -52,4 +52,4 @@ fi
applyResultsFile ${resultsFile}
export FAMILY=FABRIC
exec "${SCRIPTS:-/}start-setupWorld" "$@"
exec "$(dirname "$0")/start-setupWorld" "$@"

View File

@@ -1,7 +1,7 @@
#!/bin/bash
# shellcheck source=start-utils
. ${SCRIPTS:-/}start-utils
. "$(dirname "$0")/start-utils"
export TYPE=spongevanilla
: ${SPONGEBRANCH:=STABLE}
@@ -37,4 +37,4 @@ if [ ! -e "$SERVER" ] || [ -n "$FORCE_REDOWNLOAD" ]; then
fi
export FAMILY=SPONGE
exec "${SCRIPTS:-/}start-setupWorld" "$@"
exec "$(dirname "$0")/start-setupWorld" "$@"

View File

@@ -1,7 +1,7 @@
#!/bin/bash
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
. "$(dirname "$0")/start-utils"
isDebugging && set -x
set -o pipefail
@@ -53,4 +53,4 @@ fi
isDebugging && ls -l
export FAMILY=VANILLA
exec "${SCRIPTS:-/}start-setupWorld" "$@"
exec "$(dirname "$0")/start-setupWorld" "$@"

View File

@@ -5,7 +5,7 @@
: "${CUSTOM_JAR_EXEC:=}"
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
. "$(dirname "$0")/start-utils"
isDebugging && set -x
baseDataDir=/data
tmpServerIconPath=/tmp/icon.img

View File

@@ -1,7 +1,7 @@
#!/bin/bash
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
. "$(dirname "$0")/start-utils"
: "${RCON_CMDS_STARTUP:=}"
: "${RCON_CMDS_ON_CONNECT:=}"

View File

@@ -10,7 +10,7 @@ set -e -o pipefail
: "${REMOVE_OLD_DATAPACKS_INCLUDE:=*.zip}"
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
. "$(dirname "$0")/start-utils"
isDebugging && set -x
out_dir=/data/${LEVEL:-world}/datapacks
@@ -89,4 +89,4 @@ if [[ ${VANILLATWEAKS_FILE} || ${VANILLATWEAKS_SHARECODE} ]]; then
--pack-files="$VANILLATWEAKS_FILE"
fi
exec "${SCRIPTS:-/}start-setupModpack" "$@"
exec "$(dirname "$0")/start-setupModpack" "$@"

View File

@@ -1,7 +1,7 @@
#!/bin/bash
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
. "$(dirname "$0")/start-utils"
set -e
handleDebugMode
@@ -61,4 +61,4 @@ if [[ ${PATCH_DEFINITIONS} ]]; then
"${PATCH_DEFINITIONS}"
fi
exec "${SCRIPTS:-/}start-setupRbac" "$@"
exec "$(dirname "$0")/start-setupRbac" "$@"

View File

@@ -26,7 +26,7 @@ if [[ -n ${CF_API_KEY_FILE} ]]; then
fi
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
. "$(dirname "$0")/start-utils"
isDebugging && set -x
# CURSE_URL_BASE used in manifest downloads below
@@ -255,7 +255,6 @@ function handleGenericPacks() {
}
function handleModrinthProjects() {
: "${MODRINTH_PROJECTS:=}"
: "${MODRINTH_ALLOWED_VERSION_TYPE:=release}"
: "${MODRINTH_DOWNLOAD_DEPENDENCIES:=none}"
if [[ -v MODRINTH_DOWNLOAD_OPTIONAL_DEPENDENCIES ]]; then
@@ -263,7 +262,7 @@ function handleModrinthProjects() {
logWarning " Use MODRINTH_DOWNLOAD_DEPENDENCIES=optional instead"
fi
if [[ $MODRINTH_PROJECTS ]]; then
if [[ -v MODRINTH_PROJECTS ]]; then
if isType CUSTOM; then
if ! [[ $MODRINTH_LOADER ]]; then
@@ -366,4 +365,4 @@ case "X$MODCONFIG" in
esac
fi
exec "${SCRIPTS:-/}start-setupMounts" "$@"
exec "$(dirname "$0")/start-setupMounts" "$@"

View File

@@ -1,7 +1,7 @@
#!/bin/bash
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
. "$(dirname "$0")/start-utils"
: "${SYNC_SKIP_NEWER_IN_DESTINATION:=${PLUGINS_SYNC_UPDATE:-true}}"
: "${REPLACE_ENV_DURING_SYNC:=true}"
@@ -58,4 +58,4 @@ fi
log "Copying any configs from ${COPY_CONFIG_SRC} to ${COPY_CONFIG_DEST}"
mc-image-helper-mounts "${COPY_CONFIG_SRC}" "${COPY_CONFIG_DEST}"
exec "${SCRIPTS:-/}start-setupServerProperties" "$@"
exec "$(dirname "$0")/start-setupServerProperties" "$@"

View File

@@ -6,7 +6,7 @@ IFS=$'\n\t'
: "${EXISTING_WHITELIST_FILE:=SYNC_FILE_MERGE_LIST}"
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
. "$(dirname "$0")/start-utils"
isDebugging && set -x
if [[ -v APPEND_OPS ]] && isTrue "${APPEND_OPS}"; then
@@ -97,4 +97,4 @@ if [[ -v WHITELIST ]]; then
$WHITELIST
fi
exec "${SCRIPTS:-/}start-finalExec" "$@"
exec "$(dirname "$0")/start-finalExec" "$@"

View File

@@ -1,7 +1,7 @@
#!/bin/bash
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
. "$(dirname "$0")/start-utils"
: "${SERVER_PROPERTIES:=/data/server.properties}"
: "${OVERRIDE_SERVER_PROPERTIES:=true}"
@@ -179,4 +179,4 @@ if isTrue "${DUMP_SERVER_PROPERTIES:-false}"; then
cat "${SERVER_PROPERTIES}"
fi
exec "${SCRIPTS:-/}start-setupEnvVariables" "$@"
exec "$(dirname "$0")/start-setupEnvVariables" "$@"

View File

@@ -1,7 +1,7 @@
#!/bin/bash
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
. "$(dirname "$0")/start-utils"
set -e
isDebugging && set -x
@@ -135,4 +135,4 @@ fi
[[ -f ${worldDownload} ]] && rm ${worldDownload}
[[ -d ${tmpWorldData} ]] && rm -rf ${tmpWorldData}
exec "${SCRIPTS:-/}start-setupDatapack" "$@"
exec "$(dirname "$0")/start-setupDatapack" "$@"

View File

@@ -3,7 +3,7 @@ set -euo pipefail
IFS=$'\n\t'
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
. "$(dirname "$0")/start-utils"
handleDebugMode
: "${SPIGET_RESOURCES:=}"
@@ -142,4 +142,4 @@ if [[ ${SPIGET_RESOURCES} ]]; then
done
fi
exec "${SCRIPTS:-/}start-setupWorld" "$@"
exec "$(dirname "$0")/start-setupWorld" "$@"