From e6470719bb1f3e06c71735cf358d368388a3b950 Mon Sep 17 00:00:00 2001 From: eson <474420502@qq.com> Date: Fri, 22 Sep 2023 00:22:53 +0800 Subject: [PATCH] fix --- run_all_server.sh | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) 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 +