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