[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how to check the server can be connected or not



On Friday 03,February,2012 11:05 PM, Jon Dowland wrote:
On 03/02/12 09:55, lina wrote:
On Friday 03,February,2012 05:32 PM, Jon Dowland wrote:

while true; do
ssh server && break
done


Thanks for both of you,

the two ways once ssh server,
it stayed in server and won't come back and proceed the rest.



lina@Debian:~/Desktop$ $ while true; do ssh starfruit && break ; done
-bash-3.2$


I don't fully understand your follow-up, but to explain my solution: it
will loop as long as the ssh process returns an error code. So if the
ssh session connects successfully, upon ending the session, it will
return a success code and the loop will stop.




Reply to: