Files
spdm-backend/start_all.sh
2025-12-11 15:07:58 +08:00

41 lines
1.1 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/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 "所有服务启动成功"