1
0
mirror of https://github.com/certbot/certbot.git synced 2025-08-08 04:02:10 +03:00
Files
certbot/tools/retry.sh
Brad Warren 160b209394 Automatically retry test farm tests (#8325)
Fixes #8317.

* move retry to script

* Retry test farm tests.

* Fix retry path.
2020-09-30 17:05:52 -07:00

18 lines
374 B
Bash
Executable File

#!/bin/bash
# Retries a command if it fails.
#
# This is based on travis_retry.bash
# https://github.com/travis-ci/travis-build/blob/master/lib/travis/build/bash/travis_retry.bash.
set -e
result=0
count=1
while [[ "${count}" -le 3 ]]; do
result=0
"${@}" || result="${?}"
if [[ $result -eq 0 ]]; then break; fi
count="$((count + 1))"
sleep 1
done
exit "${result}"