app

package
v0.0.0-...-9bcc6c7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultOptions = &Options{
	ExpectedPrompt:              "password:",
	ExpectedFailure:             "denied",
	Timeout:                     time.Second * 10,
	AutoConfirmHostAuthenticity: true,
	Shell:                       "",
}

Functions

func Run

func Run(cmd string, passwords []string, options *Options) error

Run attempts to run the provided command and insert the given passwords one by one when prompted.

Types

type Options

type Options struct {
	ExpectedPrompt              string        // ExpectedPrompt is the string to treat as the password prompt e.g. "Password: "
	ExpectedFailure             string        // ExpectedFailure is the string to treat as an indication of failure e.g. "Incorrect password"
	Timeout                     time.Duration // Timeout is the duration to wait for a prompt/failure before giving up
	AutoConfirmHostAuthenticity bool          // AutoConfirmHostAuthenticity will type 'yes' on host authenticity confirmations when set
	Shell                       string        // Shell is a path to the shell to use e.g. /bin/bash - leave blank to use user shell
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL