Expect() action

The Expect action blocks a script until a particular string is sent by the host. It is valid only in NVT mode.

By default, Expect waits 30 seconds for the string to arrive. This can be overridden by a parameter.

Parameters
Expect takes one two parameters.

The first parameter is the string to wait for. The string can include C escape sequences (\r, \n, \b, \t, \onnn, \xnn), but there is no wild-carding or regular expression matching.

The optional second parameter is a timeout, in seconds.

Return value
Expect returns nothing if it succeeds. If the timeout expires before the string arrives, it will fail.

Examples
Wait for a username prompt. Expect("Login: ")