Advertisement
Spelendora

Untitled

Apr 11th, 2017
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. if [ -z "$1" ]; then
  4. echo '' && echo 'Please also provide server name as in config file...' &&
  5. exit 1
  6. fi
  7.  
  8. retries=0
  9. repeat=true
  10. today=$(date)
  11.  
  12. while "$repeat"; do
  13. ((retries+=1)) &&
  14. echo "Try number $retries..." &&
  15. today=$(date) &&
  16. ssh -R 52698:localhost:52698 "$@" &&
  17. repeat=false
  18. if "$repeat"; then
  19. sleep 5
  20. fi
  21. done
  22.  
  23. echo "Total number of tries: $retries"
  24. echo "Last connection at: $today"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement