Searching for host...
Network error: Connection timed out.
Searching for host...
Connecting to host...
Authenticating...
Hard to tell without seeing the script. But from the output above I suppose that you have two open commands in the script, where the first one fails.