#!/usr/bin/expect -f
set timeout -1
if {![info exists env(SUDO_PASSWORD)] || $env(SUDO_PASSWORD) eq ""} {
  puts "Missing SUDO_PASSWORD env variable."
  exit 1
}
set sudo_password $env(SUDO_PASSWORD)
spawn ssh -J wooo@192.168.0.110 wooo@192.168.0.188 "cd /home/wooo/deployments/agent-bounty-protocol && docker compose exec -T web npx tsx seed.ts"
expect {
  "*assword:*" {
    send "$sudo_password\r"
    exp_continue
  }
  eof
}
