#!/bin/bash
# LuckySt Trading Stack — Stop all services
ROOT="$(cd "$(dirname "$0")" && pwd)"

echo "Stopping Telegram bot..."
pkill -f "python3 telegram_bot.py" 2>/dev/null && echo "  Stopped." || echo "  Not running."

echo "Stopping Celery workers..."
pkill -f "celery.*trading_tasks" 2>/dev/null && echo "  Stopped." || echo "  Not running."

echo "Stopping backend..."
pkill -f "uvicorn app.main:app" 2>/dev/null && echo "  Stopped." || echo "  Not running."

echo "Stopping infrastructure (Postgres, Redis, RabbitMQ)..."
cd "$ROOT/backend" && docker-compose stop postgres redis rabbitmq 2>/dev/null && echo "  Stopped." || echo "  Not running."

echo ""
echo "All services stopped."
