[WIP] add config parameter to start.sh

This commit is contained in:
Leonard Steppy 2025-12-24 23:24:44 +01:00
parent 61cb39b414
commit 3e0ace43d2
2 changed files with 14 additions and 5 deletions

View File

@ -56,7 +56,6 @@ function main {
;;
"--fetch")
fetch=true
quiet=true
;;
"--quiet" | "-q")
quiet=true
@ -89,6 +88,7 @@ function main {
# fetch current configuration
if $fetch; then
quiet=true
if [ "$(yq '.proxies.velocity.enabled // false' config/paper-global.yml)" = "true" ]; then
echo "velocity"
elif [ "$(yq '.settings.bungeecord // false' spigot.yml)" = "true" ]; then

View File

@ -10,12 +10,18 @@ function main {
local bungee=false
local help=false
local sleep_seconds=$DEFAULT_SLEEP_SECONDS
local config=""
local cmd=$0
# TODO --config is incompatible with --proxy, --bungee and standalone
while [ $# -gt 0 ]; do
local arg=$1
case "$arg" in
"--config" | "-c")
config=$2 #TODO ensure mode is valid
shift 2
;;
"--sleep" | "-s")
sleep_seconds=$2
shift 2
@ -50,13 +56,16 @@ function main {
echo "Usage $cmd [OPTIONS]"
echo ""
echo "OPTIONS:"
echo " -s --sleep How many seconds to sleep after the server has stopped before starting it again"
echo " -h --help Show help"
echo " --proxy Start the server behind a velocity proxy"
echo " --bungee Start the server behind a bungeecord proxy"
echo " -c --config <mode> How to configure the server. Possible values for mode are: proxy, bungee, standalone"
echo " -s --sleep <secs> How many seconds to sleep after the server has stopped before starting it again"
echo " -h --help Show help"
echo " --proxy Start the server behind a velocity proxy"
echo " --bungee Start the server behind a bungeecord proxy"
exit
fi
# TODO perform configuration according to config parameter
if $proxy; then
./configure.sh velocity