fundplatform/scripts/status-all.sh
zhangjf dfce5b0566 refactor: 统一脚本管理,优化Assembly打包配置
- 将各服务脚本统一到项目根目录scripts目录
- Assembly配置引用根目录scripts,避免重复
- 脚本自动从目录名推断服务名称
- 排除docker相关配置文件(application-docker.yml)
- 新增env.properties环境变量配置模板
- 更新单机部署文档至v2.1
2026-02-22 14:43:41 +08:00

42 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# 查看所有服务状态
DEPLOY_HOME="/opt/fundplatform/deploy"
SERVICES=(
"fund-gateway:8000"
"fund-sys:8100"
"fund-cust:8200"
"fund-proj:8300"
"fund-req:8400"
"fund-exp:8500"
"fund-receipt:8600"
"fund-report:8700"
"fund-file:8800"
)
echo "=========================================="
echo " Service Status"
echo "=========================================="
printf "%-20s %-10s %-10s %s\n" "Service" "Port" "Status" "PID"
echo "------------------------------------------"
for item in "${SERVICES[@]}"; do
service="${item%%:*}"
port="${item##*:}"
pid_file="${DEPLOY_HOME}/${service}/${service}.pid"
if [ -f "$pid_file" ]; then
PID=$(cat $pid_file)
if ps -p $PID > /dev/null 2>&1; then
printf "%-20s %-10s \033[32m%-10s\033[0m %s\n" "$service" "$port" "RUNNING" "$PID"
else
printf "%-20s %-10s \033[31m%-10s\033[0m %s\n" "$service" "$port" "STOPPED" "-"
fi
else
printf "%-20s %-10s \033[31m%-10s\033[0m %s\n" "$service" "$port" "STOPPED" "-"
fi
done
echo "=========================================="