#!/usr/bin/env bash set -euo pipefail if [[ $# -lt 1 || $# -gt 2 ]]; then echo "用法:$0 <服务端 JAR 路径> [端口]" >&2 exit 2 fi project_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" run_directory="$project_root/run" jar_path="$(realpath "$1")" port="${2:-25565}" mkdir -p "$run_directory" cp -f "$jar_path" "$run_directory/infstar.jar" cat > "$run_directory/server.properties" < "$run_directory/eula.txt" echo "测试服务器已准备完成:$run_directory"