Compare commits
No commits in common. "c1adf06d67299e227b2122217834bb555175566f" and "e5cf6638cc957a1f93a9e65dfe9a879d3f723aa6" have entirely different histories.
c1adf06d67
...
e5cf6638cc
3
go.mod
3
go.mod
@ -49,6 +49,3 @@ require (
|
|||||||
)
|
)
|
||||||
|
|
||||||
replace fusen-basic v0.0.0 => gitee.com/fusenpack/fusen-basic v0.0.5-0.20231124072222-16de191b1dbe
|
replace fusen-basic v0.0.0 => gitee.com/fusenpack/fusen-basic v0.0.5-0.20231124072222-16de191b1dbe
|
||||||
|
|
||||||
|
|
||||||
replace fusen-model v0.0.0 => gitee.com/fusenpack/fusen-model v0.0.1
|
|
2
proto
2
proto
@ -1 +1 @@
|
|||||||
Subproject commit 17944a978e7279c85564988364fd283ddeaaf98b
|
Subproject commit cbab13f32436a22e47eaa01bac51211063b16155
|
@ -1,58 +0,0 @@
|
|||||||
#! /bin/bash
|
|
||||||
|
|
||||||
# 获取当前脚本的全局路径
|
|
||||||
script_path=$(realpath "$0")
|
|
||||||
|
|
||||||
# 获取当前脚本的目录
|
|
||||||
script_dir=$(dirname "$script_path")
|
|
||||||
|
|
||||||
# 执行更新最新的包
|
|
||||||
$script_dir/update_fspkg_master.sh
|
|
||||||
|
|
||||||
# 拼接service_config.ini的路径
|
|
||||||
config_file="$script_dir/server/service_config.ini"
|
|
||||||
|
|
||||||
# 检查文件是否存在
|
|
||||||
if [[ ! -f "$config_file" ]]; then
|
|
||||||
echo "Error: service_config.ini 文件不存在"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "read $config_file"
|
|
||||||
service_name=$(grep "SERVICE_NAME=" $config_file | cut -d'=' -f2 | cut -d' ' -f1)
|
|
||||||
|
|
||||||
# 输出变量值
|
|
||||||
echo "service name: $service_name"
|
|
||||||
|
|
||||||
cd $script_dir/proto
|
|
||||||
git pull origin master
|
|
||||||
cd $script_dir
|
|
||||||
go run -gcflags="-N" proto/goutils/proto_build/main.go
|
|
||||||
|
|
||||||
run_server() {
|
|
||||||
# 导航到相应的目录
|
|
||||||
cd $script_dir/server
|
|
||||||
echo "build $service_name"
|
|
||||||
go build -o $service_name
|
|
||||||
|
|
||||||
# 如果之前存在相同名字的 screen 会话,先将其终止
|
|
||||||
# 首先尝试关闭已存在的screen会话
|
|
||||||
existing_session=$(screen -ls | grep -w "$service_name")
|
|
||||||
if [ -n "$existing_session" ]; then
|
|
||||||
echo "Terminating existing screen session for $service_name"
|
|
||||||
screen -S "$service_name" -X quit
|
|
||||||
while [[ $(screen -ls | grep "\.$service_name\s") ]]; do
|
|
||||||
sleep 0.1s # 等待0.1秒后再次检查
|
|
||||||
echo "wait for $service_name"
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 循环检查screen进程是否存在
|
|
||||||
|
|
||||||
[ -f .gitignore ] || (echo "server" > .gitignore && echo "$service_name" >> .gitignore && echo "main" >> .gitignore)
|
|
||||||
|
|
||||||
echo "Running $service_name"
|
|
||||||
screen -dmS $service_name -L ./$service_name
|
|
||||||
}
|
|
||||||
|
|
||||||
run_server
|
|
Loading…
x
Reference in New Issue
Block a user