keep-waiting.sh 785 B

1234567891011121314
  1. #!/usr/bin/env bash
  2. # Hold the Security Lead's turn while the scan workflow runs: wait, then tell the
  3. # caller to run this again unless the workflow's result has arrived.
  4. # Usage: keep-waiting.sh [SECONDS] (1 to 110, default 90; exits 2 on a bad value)
  5. # The wait stays under the Bash tool's two-minute default timeout, past which a
  6. # command is moved to the background and no longer holds the turn.
  7. seconds=${1:-90}
  8. case $seconds in '' | *[!0-9]*) seconds=0 ;; esac
  9. if [ "$seconds" -lt 1 ] || [ "$seconds" -gt 110 ]; then
  10. echo "usage: keep-waiting.sh [SECONDS between 1 and 110]" >&2
  11. exit 2
  12. fi
  13. sleep "$seconds"
  14. echo "Waited ${seconds}s. If the scan workflow's result has not arrived, run this same command again now; do not reply to the user or end your turn until it arrives."