自动获取服务列表
This commit is contained in:
parent
d7dc0406f6
commit
bfa1872595
|
@ -23,7 +23,13 @@ run_server() {
|
||||||
}
|
}
|
||||||
|
|
||||||
# 列出所有服务器目录
|
# 列出所有服务器目录
|
||||||
server_dirs=("backend" "canteen" "data-transfer" "home-user-auth" "inventory" "map-library" "orders" "product" "product-model" "product-template" "shopping-cart-confirmation" "upload" "webset")
|
server_dirs=() # 初始化一个空数组
|
||||||
|
|
||||||
|
for dir in server/*/ ; do # 遍历 "server/" 下的所有子目录
|
||||||
|
dir=${dir%*/} # 删除末尾的 "/"
|
||||||
|
dir=${dir##*/} # 删除开头的 "server/"
|
||||||
|
server_dirs+=("$dir") # 添加到数组
|
||||||
|
done
|
||||||
|
|
||||||
# 在每个服务器目录下运行相应的 go 程序
|
# 在每个服务器目录下运行相应的 go 程序
|
||||||
for server_dir in "${server_dirs[@]}"; do
|
for server_dir in "${server_dirs[@]}"; do
|
||||||
|
|
|
@ -16,7 +16,13 @@ stop_server() {
|
||||||
}
|
}
|
||||||
|
|
||||||
# 列出所有服务器目录
|
# 列出所有服务器目录
|
||||||
server_dirs=("backend" "canteen" "data-transfer" "home-user-auth" "inventory" "map-library" "orders" "product" "product-model" "product-template" "shopping-cart-confirmation" "upload" "webset")
|
server_dirs=() # 初始化一个空数组
|
||||||
|
|
||||||
|
for dir in server/*/ ; do # 遍历 "server/" 下的所有子目录
|
||||||
|
dir=${dir%*/} # 删除末尾的 "/"
|
||||||
|
dir=${dir##*/} # 删除开头的 "server/"
|
||||||
|
server_dirs+=("$dir") # 添加到数组
|
||||||
|
done
|
||||||
|
|
||||||
# 停止每个服务器的 screen 会话
|
# 停止每个服务器的 screen 会话
|
||||||
for server_dir in "${server_dirs[@]}"; do
|
for server_dir in "${server_dirs[@]}"; do
|
||||||
|
|
Loading…
Reference in New Issue
Block a user