message: Add option to automatically shut down `sandbox.sh`
diff: @@ -126,6 +126,19 @@ def run(args):
  )
  LOG.warning("Press Ctrl+C to shutdown the network")
  + if args.auto_shutdown:
  + if args.auto_shutdown_delay_s > 0:
  + LOG.info(
  + f"Waiting {args.auto_shutdown_delay_s}s before automatic shutdown..."
  + )
  + try:
  + time.sleep(args.auto_shutdown_delay_s)
  +
  + except KeyboardInterrupt:
  + LOG.info("Stopping all CCF nodes...")
  +
  + LOG.info("Automatically shut down network after successful opening")
  + else:
  try:
  while True:
  time.sleep(60)
  @@ -180,6 +193,18 @@ if __name__ == "__main__":
  "--common-dir",
  help="Directory containing previous network member identities",
  )
  + parser.add_argument(
  + "--auto-shutdown",
  + help="If set, service automatically shuts down after successful opening",
  + action="store_true",
  + default=False,
  + )
  + parser.add_argument(
  + "--auto-shutdown-delay-s",
  + help="If --auto-shutdown is set, delay after which service automatically stops",
  + type=int,
  + default=0,
  + )
  args = infra.e2e_args.cli_args(add)
  if args.recover and not all([args.ledger_dir, args.common_dir]):
  