#!/bin/bash -x where="$1" test -z "$where" && echo >&2 "no host specified" && exit 1 while true; do ssh -o PasswordAuthentication=no -o StrictHostKeyChecking=no \ -q "$where" exit &>/dev/null && exit 0 done exit 1