title: How to create a bash script to check the SSH connection?
body: <p>I am in the process of creating a bash script that would log into the remote machines and create private and public keys.</p>
  
  <p>My problem is that the remote machines are not very reliable, and they are not always up. I need a bash script that would check if the SSH connection is up. Before actually creating the keys for future use.</p>