Files
planet/stop.sh
2026-03-05 11:46:58 +08:00

39 lines
845 B
Bash
Executable File
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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
# Planet 停止脚本
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
echo "🛑 停止智能星球计划..."
# 停止后端服务
if pgrep -f "uvicorn" > /dev/null; then
echo "🔧 停止后端服务..."
pkill -f "uvicorn" || true
echo "✅ 后端服务已停止"
else
echo " 后端服务未运行"
fi
# 停止前端服务
if pgrep -f "vite" > /dev/null; then
echo "🌐 停止前端服务..."
pkill -f "vite" || true
echo "✅ 前端服务已停止"
else
echo " 前端服务未运行"
fi
# 停止 Docker 容器
echo "🗄️ 停止数据库容器..."
if command -v docker-compose &> /dev/null; then
docker-compose stop postgres redis || true
else
docker compose stop postgres redis || true
fi
echo ""
echo "✅ 所有服务已停止"