diff --git a/run_all_server.sh b/run_all_server.sh index 9e005b95..43723946 100755 --- a/run_all_server.sh +++ b/run_all_server.sh @@ -51,17 +51,22 @@ for server_dir in "${server_dirs[@]}"; do done -# 定义目录和screen名称 -dir_path="./proxyserver" -screen_name="proxyserver" +if [ -n "$single_server_name" ]; then + echo "no proxyserver restart" +else + # 定义目录和screen名称 + dir_path="./proxyserver" + screen_name="proxyserver" -# 进入目录 -cd $dir_path -# 检查是否存在screen session -if screen -list | grep -q "$screen_name"; then - # 结束存在的screen session - screen -S $screen_name -X quit + # 进入目录 + cd $dir_path + # 检查是否存在screen session + if screen -list | grep -q "$screen_name"; then + # 结束存在的screen session + screen -S $screen_name -X quit + fi + go build + # 启动新的screen session并运行go程序 + screen -dmS $screen_name -L ./$screen_name fi -go build -# 启动新的screen session并运行go程序 -screen -dmS $screen_name -L ./$screen_name \ No newline at end of file +