admin.vm.Console 507 B

123456789
  1. #!/bin/bash
  2. lock="/var/run/qubes/$QREXEC_REQUESTED_TARGET.terminal.lock"
  3. qvm-check --quiet --running "$QREXEC_REQUESTED_TARGET" > /dev/null 2>&1 || { echo "Error: domain '$QREXEC_REQUESTED_TARGET' does not exist or is not running"; exit 1; }
  4. # Create an exclusive lock to ensure that multiple qubes cannot access to the same socket
  5. # In the case of multiple qrexec calls it returns a specific exit code
  6. sudo flock -n -E 200 -x "$lock" socat - OPEN:"$(virsh -c xen ttyconsole "$QREXEC_REQUESTED_TARGET")"