Just found it and was just what i needed

I was looking for a script to check the connection to an sftp server, this script provides that an more, I just added some minor enhancements to make it more practical (in case you don’t need to check the number of lines)