Currently it is just regular old read/regex code, but I do have plans to add the expect features once I get this part working.... and I do have ssh keys set up. I'm not passing it a password when I create the object (mostly because this is running under an account where not everyone should know the password).
It always happens on server2, but server2 is no different than server1. They have the same OS version, and the ID is the same for both, (automounted home directory) so it's using the same profile and env variables and all that.
It's not too much trouble to regex out the prompt, I can do that easily enough, I was just hoping there was some cool Expect feature that would do that for me, or maybe I was doing something wrong.
One other thing I'm running into, however, is that when I come across a server that my key doesn't work on (ie one that does not use autofs for home directories) I get a password prompt. I'd like to be able to just detect these, add it to my no-connect list with a comment, so I can get a list of servers that need a manual key set up later, but instead it's trying to execute the commands, (in essence pressing enter 3 times) then getting the permission denied keyboard/interactive message, then the SSH connection dies, so I receive the SSHProcessError message.
It's obvious to me I need to use more of the expect features, as that would (probably) easily fix my most recent problem, but it does lead me to another question:
If I create an ssh connection, then issue a waitfor (or expect) statement, what keeps the prompt from displaying too fast for the waitfor, so then I'm waiting for nothing until the timeout. For example:
1. ssh serverX
2. (serverX asks for a password - Password:)
3. waitfor "
Ppassword:"
What keeps that from happening, or does it just queue up in STDIN?
Thanks!