IP_PICKER - Ask the user to interactively enter an IP via the UI

When to use it

Whenever an IP address is needed, IP_PICKER supplies a custom keyboard optimized for IPv4 entry. Providing a default IP address allows saved values to be presented to the user for faster selection.

Syntax

  IP_PICKER [text prompt] [default ip]
  

text prompt

Text prompt to show the user. Prompts should be kept short enough to display on the device screen.

default ip

Default IP address.

The IP picker dialog

The IP picker dialog

The IP picker editor

The IP picker editor

Results

IP_PICKER will wait until the user has made a selection, pausing the payload.

IP_PICKER exits with a return code of 0 if the user continues, and non-zero if the user cancels.

IP_PICKER returns the IP as the output.

Examples

  __userip=$(IP_PICKER "Target IP" "1.2.3.4") || exit 0
  
  __userip=$(IP_PICKER "No default IP" "") || exit 0