run.sh: Fix retry logic