#!/usr/bin/env bash set -e DIR="/Users/ingowagner/evOo" SESSION="evoo" export PATH="/Users/ingowagner/.nvm/versions/node/v22.22.0/bin:/opt/homebrew/bin:/usr/local/bin:$PATH" # Check if session already exists if /opt/homebrew/bin/tmux has-session -t "$SESSION" 2>/dev/null; then echo "โš ๏ธ tmux session '$SESSION' is already running!" echo "๐Ÿ‘‰ Attach using: tmux attach -t $SESSION" exit 0 fi echo "๐Ÿš€ Starting evOo in background tmux session '$SESSION'..." # Create session with platform window /opt/homebrew/bin/tmux new-session -d -s "$SESSION" -n "platform" -c "$DIR" /opt/homebrew/bin/tmux send-keys -t "$SESSION:platform" 'export PATH="/Users/ingowagner/.nvm/versions/node/v22.22.0/bin:/opt/homebrew/bin:/usr/local/bin:$PATH" && pnpm dev' C-m # Create sentinel window /opt/homebrew/bin/tmux new-window -t "$SESSION" -n "sentinel" -c "$DIR" /opt/homebrew/bin/tmux send-keys -t "$SESSION:sentinel" 'export PATH="/Users/ingowagner/.nvm/versions/node/v22.22.0/bin:/opt/homebrew/bin:/usr/local/bin:$PATH" && pnpm exec tsx scripts/autonomous-sentinel.ts' C-m # Set active window back to platform /opt/homebrew/bin/tmux select-window -t "$SESSION:platform" echo "โœ… evOo successfully started in tmux session '$SESSION'!" echo "" echo "๐Ÿ“ฑ iPhone Access:" echo " - WLAN: http://192.168.0.205:5173" echo " - Tailscale: http://100.127.149.82:5173" echo "" echo "๐Ÿ” Management Commands:" echo " - Logs ansehen: tmux attach -t $SESSION" echo " - Aus tmux raus: Ctrl+b gefolgt von d (Session lรคuft weiter!)" echo " - Fenster wechseln in tmux: Ctrl+b gefolgt von 0 (Platform) oder 1 (Sentinel)" echo " - Komplett stoppen: bash scripts/stop-tmux.sh"