hyagency

Isolated hyprland desktop for agents.
git clone https://unitehenry.com/git/hyagency.git
Log | Files | Refs | README

serve (543B)


      1 #!/usr/bin/env bash
      2 
      3 set -euo pipefail
      4 
      5 export TUNNEL_HOST="${TUNNEL_HOST:-}"
      6 
      7 declare -a PIDS
      8 
      9 cleanup() {
     10   for pid in "${PIDS[@]}"; do
     11     if kill -0 "$pid" 2>/dev/null; then
     12       echo "  Killing $pid"
     13       kill "$pid" 2>/dev/null || true
     14       wait "$pid" 2>/dev/null || true
     15     fi
     16   done
     17 }
     18 
     19 trap cleanup EXIT
     20 
     21 sudo -v
     22 
     23 ./scripts/guacamole &
     24 PIDS+=($!)
     25 
     26 ./scripts/chromium &
     27 PIDS+=($!)
     28 
     29 ./scripts/opencode &
     30 PIDS+=($!)
     31 
     32 ./scripts/virtual &
     33 PIDS+=($!)
     34 
     35 if [ -n "$TUNNEL_HOST" ]; then
     36   ./scripts/tunnel &
     37   PIDS+=($!)
     38 fi
     39 
     40 sleep infinity