Files
Cortex-Inara/dev-restart.sh
Scott Idem 8ba5247ef5 tooling: install script, workspace file, and dev-restart helper
- install.py — idempotent setup script (venv, systemd service, linger,
  auth checks); supports --check for read-only status inspection
- .stignore — exclude .venv and runtime dirs from Syncthing so each
  host maintains its own machine-local venv
- Cortex_and_Inara.code-workspace — VS Code workspace (service, personas,
  docs folders; launch config for uvicorn --reload)
- dev-restart.sh — SSH wrapper to restart Cortex on the gaming laptop
  and tail logs; supports restart / logs / status subcommands

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 19:11:27 -04:00

27 lines
931 B
Bash
Executable File

#!/usr/bin/env bash
# dev-restart.sh — restart Cortex on the gaming laptop and tail logs
# Usage:
# ./dev-restart.sh restart and show last 30 log lines
# ./dev-restart.sh logs tail live logs (ctrl-c to stop)
# ./dev-restart.sh status show service status only
# "scott-lt-i7-rtx" or "192.168.32.19"
CORTEX_HOST="scott-lt-i7-rtx" # hostname or IP of the machine running Cortex
SERVICE="cortex"
case "${1:-restart}" in
logs)
echo "→ Tailing $SERVICE logs on $CORTEX_HOST (ctrl-c to stop)"
ssh "$CORTEX_HOST" "journalctl --user -u $SERVICE -f --no-pager"
;;
status)
ssh "$CORTEX_HOST" "systemctl --user status $SERVICE --no-pager -l"
;;
restart|*)
echo "→ Restarting $SERVICE on $CORTEX_HOST"
ssh "$CORTEX_HOST" "systemctl --user restart $SERVICE"
echo "→ Last 30 log lines:"
ssh "$CORTEX_HOST" "journalctl --user -u $SERVICE --no-pager -n 30"
;;
esac