larpaso-website/claude-remote/claude/rc-loop.sh
Pascal Scholz 30418ea841 Add Claude remote-control stack with shared MCP mailbox
Containers for Pascal and Lara run claude remote-control per project
(larpaso, youtube) on the VPS, isolated from the web stack, and exchange
messages through a small MCP mailbox server.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 19:25:54 +01:00

28 lines
852 B
Bash

#!/bin/bash
# Hält einen Remote-Control-Server für ein Projekt am Laufen.
# Aufruf: rc-loop <projektordner> <git-url>
dir="$1"
url="$2"
while true; do
if [ ! -d "$dir/.git" ]; then
echo "[$(date '+%F %T')] Klone $url nach $dir ..."
if ! git clone "$url" "$dir"; then
echo "Klonen fehlgeschlagen (SSH-Key in Forgejo hinterlegt? Repo vorhanden?). Neuer Versuch in 60 s."
sleep 60
continue
fi
fi
if [ ! -s "$HOME/.claude/.credentials.json" ]; then
echo "Noch nicht eingeloggt. Einmalig im Container 'claude' starten und /login ausführen. Neuer Versuch in 60 s."
sleep 60
continue
fi
cd "$dir" || exit 1
echo "[$(date '+%F %T')] Starte Remote-Control-Server in $dir"
claude remote-control --spawn worktree
echo "[$(date '+%F %T')] Server beendet (Exit $?). Neustart in 30 s."
sleep 30
done