#!/bin/bash

declare -i tries=5

while [[ $tries>0 ]]; do
  #echo "ssh $*"
  ssh -o ConnectTimeout=10 $*
  # TODO the wrap ssh does always return -1
  exit $? 
  rc=$?
  if [[ $rc != 255 ]]; then exit $rc ; fi
  echo "$tries tries remaining"
  declare tries=$tries-1
done
