#!/bin/bash
    # 给执行权限 
    chmod +rx start.sh
    chmod +rx TShock.Server
	
	# 设置环境变量
    export DOTNET_ROOT=$(pwd)/dotnet
    export PATH=$DOTNET_ROOT:$PATH
	
while true; do
    clear
    echo "正在启动 TShock 服务器..."
    ./TShock.Server -lang 7 -config server.properties -port "${SERVER_PORT}"
    echo
    echo "服务器已关闭，将在 5 秒后自动重启..."
    echo
    sleep 5
done