forked from toolchaintechnologycenter/spdm-backend
配置文件
This commit is contained in:
41
start_all.sh
Normal file
41
start_all.sh
Normal file
@@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 定义要启动的目录顺序
|
||||
directories=("capability" "data" "flowable" "gateway2" "pbs" "system" "task" "project")
|
||||
base_dir="/home/app"
|
||||
|
||||
# 遍历目录并执行start.sh(传递--silent参数)
|
||||
for dir in "${directories[@]}"; do
|
||||
script_path="${base_dir}/${dir}/start.sh"
|
||||
|
||||
# 检查脚本是否存在
|
||||
if [ -f "$script_path" ]; then
|
||||
echo "正在启动 ${dir} 服务..."
|
||||
|
||||
# 检查脚本是否可执行
|
||||
if [ ! -x "$script_path" ]; then
|
||||
echo "为 ${script_path} 添加执行权限..."
|
||||
chmod +x "$script_path"
|
||||
fi
|
||||
|
||||
# 传递--silent参数启动,不显示实时日志
|
||||
"$script_path" --silent
|
||||
|
||||
# 检查执行结果
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "${dir} 服务启动成功"
|
||||
else
|
||||
echo "错误: ${dir} 服务启动失败,终止后续启动流程"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "错误: ${script_path} 不存在,终止启动流程"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "----------------------------------------"
|
||||
done
|
||||
|
||||
echo "所有服务启动成功"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user