From 3e0ace43d2e47dca4c4aee0336ca5765c6f219bd Mon Sep 17 00:00:00 2001 From: Leonard Steppy Date: Wed, 24 Dec 2025 23:24:44 +0100 Subject: [PATCH] [WIP] add config parameter to start.sh --- configure.sh | 2 +- start.sh | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/configure.sh b/configure.sh index b304190..3b85013 100755 --- a/configure.sh +++ b/configure.sh @@ -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 diff --git a/start.sh b/start.sh index faf42bc..d6a65f9 100755 --- a/start.sh +++ b/start.sh @@ -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 How to configure the server. Possible values for mode are: proxy, bungee, standalone" + 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" exit fi + # TODO perform configuration according to config parameter + if $proxy; then ./configure.sh velocity