#!/bin/sh HOST=$1 while true; do ssh $HOST echo -n "Reconnect to $HOST (Y/n)? " read cont if [ "$cont" = "n" ]; then exit fi done