I am on a sun solaris server and trying to create a script that will test if SFTP is up and running on a remote server (which could be unix or windows).
My thought was to simply invoke sftp and if I get the prompt ofr "Password" then that is an indication that the service is running and I am done.
The problem is that the "prompt" for password takes over the and is wainting for a reply.
This script will run as a sceduled task (cron) to validate the service is up and will simply hang.
Is there a way to capture the fact that password is prompted for and then terminate the script.