#!/bin/bash # Configuration UNRAID_HOST="root@192.168.2.61" REMOTE_PATH="/boot/config/plugins/compose.manager/projects/subspace-tv" usage() { echo "Usage: $0 " echo "" echo "Commands:" echo " logs - View live container logs" echo " status - Show container status" echo " restart - Restart container" echo " stop - Stop container" echo " start - Start container" echo " rebuild - Full rebuild and restart" echo " shell - SSH to Unraid at project directory" exit 1 } remote_cmd() { ssh "$UNRAID_HOST" "cd $REMOTE_PATH && $1" } case "$1" in logs) ssh -t "$UNRAID_HOST" "cd $REMOTE_PATH && docker compose logs -f" ;; status) echo "=== Container Status ===" remote_cmd "docker compose ps" ;; restart) echo "Restarting container..." remote_cmd "docker compose restart" echo "Done" ;; stop) echo "Stopping container..." remote_cmd "docker compose down" echo "Done" ;; start) echo "Starting container..." remote_cmd "docker compose up -d" echo "Done" ;; rebuild) echo "Rebuilding container..." remote_cmd "docker compose down && docker compose up -d --build" echo "Done" ;; shell) ssh -t "$UNRAID_HOST" "cd $REMOTE_PATH && bash" ;; *) usage ;; esac