Added retry to server connection in bash script