What I usually do when I need a retry logic is
for i in {0..60}; do
true -- "$i" # shelleck surpression
if eventually_succeeds; then break; fi
sleep 1s
done
Not super elegant, but relatively correct, next level is exponential back off. Generally leaves a bit of composability around.