How To Repeat A Command Until It Succeeds In Linux - OSTechNix
for example 2 seconds, and then try to ping ostechnix.com. In other words, the While command will keep pinging the site every 2 seconds. Once the condition becomes false, the while loop will terminate.