Welcome to mirror list, hosted at ThFree Co, Russian Federation.

retry.sh « tools - github.com/certbot/certbot.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 964aab8eaad66270af0308de6296d8ac01acc800 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/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}"