Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- [ -z $1 ] && echo "Usage: $0 <ssh_host> [ssh_options]" && exit
- SSH_HOST=$1 # FIXME: Host may be defined anywhere
- [ "$1" == "-p" ] && SSH_PORT=$2 && SSH_HOST=$3 # FIXME: Port may be defined anywhere
- [ "$2" == "-p" ] && SSH_PORT=$3 && SSH_HOST=$1 # FIXME: Port may be defined anywhere
- [ -z $SSH_PORT ] && SSH_PORT=22
- until nc -w 1 $SSH_HOST $SSH_PORT < /dev/null | grep -i ssh ; do
- sleep 1
- done
- ssh $*
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement