Comments on: SSH auto-reconnect https://backreference.org/2013/04/26/ssh-auto-reconnect/ Proudly uncool and out of fashion Tue, 07 Oct 2014 13:45:52 +0000 hourly 1 https://wordpress.org/?v=5.8.2 By: Toni https://backreference.org/2013/04/26/ssh-auto-reconnect/#comment-25140 Tue, 07 Oct 2014 13:45:52 +0000 http://backreference.org/?p=4078#comment-25140 Stumbled upon this and it is really useful. To avoid this messages:

ssh: connect to host scooter port 22: Connection refused
ssh: connect to host scooter port 22: No route to host

just add "-q"

sssh(){
while true; do command ssh -q "$@"; [ $? -eq 0 ] && break || sleep 0.5; done
}

]]>