> For the complete documentation index, see [llms.txt](https://documentation.hak5.org/packet-squirrel-mark-ii/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.hak5.org/packet-squirrel-mark-ii/payload-development/duckyscript-for-packet-squirrel/usb_wait.md).

# USB\_WAIT

The `USB_WAIT` command pauses until USB storage is attached.

Payloads which require USB storage can use this to wait until a USB drive is connected.

## Options

By default, `USB_WAIT` controls the LED to indicate that it is waiting for input; by setting the `NO_LED` environment variable first, `USB_WAIT` can be told to leave the LED alone:

```bash
NO_LED=1 USB_WAIT
```

## Experimenting

You can experiment using the `USB_WAIT` command live, either in the Web Shell in the web UI, or via `ssh`!

The terminal will pause until you cancel the command by pressing `control-c` or a USB storage device is attached.

## Examples

Payloads can delay indefinitely until USB storage is attached using the `USB_WAIT` command.

```bash
#!/bin/bash

# Title: USB_WAIT demo
# 
# Description: Wait until USB storage is attached.

NETMODE NAT

USB_WAIT

LED G SINGLE
```
