Script to check if host key authentication is setup

Hey all,

I have a script that I use for some automated installs. Unfortunately for the script to work the server that it's running from needs to have host-key authentication setup to the target server. If it isn't setup beforehand and the script is executed the install partially completes and gets very messy.

Currently I have it set to ask the user to confirm host key auth is setup before continuing but that takes away the automated functionality I'm hoping for. Does anyone here knows of a way to "test" whether or not host-key auth is setup correctly before starting the install. I'm sure it's possible with expect but I'm hoping to avoid using that method.

Thanks in advance!

No ideas?