diff --git a/start.sh b/start.sh index d6a65f9..675994f 100755 --- a/start.sh +++ b/start.sh @@ -11,15 +11,28 @@ function main { local help=false local sleep_seconds=$DEFAULT_SLEEP_SECONDS local config="" + local start_proxy=false 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 + local mode=$2 + case "$mode" in + "proxy" | "bungee" | "standalone") + ;; + case *) + err "Invalid mode for --config: $mode" + ;; + esac + config=$mode + if $proxy; then + err "--config can't be used together with --proxy" + elif $bungee; then + err "--config can't be used together with --bungee" + fi shift 2 ;; "--sleep" | "-s") @@ -30,6 +43,8 @@ function main { proxy=true if $bungee; then err "--proxy can't be used together with --bungee" + elif [[ -n $config ]]; then + err "--proxy can't be used together with --config" fi shift ;; @@ -37,6 +52,8 @@ function main { bungee=true if $proxy; then err "--bungee can't be used together with --proxy" + elif [[ -n $config ]]; then + err "--bungee can't be used together with --config" fi shift ;;