#!/bin/bash
# Stop Tdarr Node Script
set -e

CONTAINER_NAME="tdarr-node-gpu-unmapped"

echo "🛑 Stopping Tdarr Node: ${CONTAINER_NAME}"

if podman ps --format "{{.Names}}" | grep -q "^${CONTAINER_NAME}$"; then
    podman stop "${CONTAINER_NAME}" 2>/dev/null || true
    echo "✅ Tdarr Node stopped successfully"
else
    echo "ℹ️  Tdarr Node was not running"
fi