Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- if [ -z "$1" ]; then
- echo '' && echo 'Please also provide server name as in config file...' &&
- exit 1
- fi
- retries=0
- repeat=true
- today=$(date)
- while "$repeat"; do
- ((retries+=1)) &&
- echo "Try number $retries..." &&
- today=$(date) &&
- ssh -R 52698:localhost:52698 "$@" &&
- repeat=false
- if "$repeat"; then
- sleep 5
- fi
- done
- echo "Total number of tries: $retries"
- echo "Last connection at: $today"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement