Skip to content

Commit

Permalink
use arithmetics in curl_retry_on_18 while loop
Browse files Browse the repository at this point in the history
((attempts++)) evaluates to 1 on first call, causing an error with set -o errtrace
  • Loading branch information
dzuelke committed Jul 25, 2018
1 parent 3df92ff commit e3867d9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions bin/util/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ export_env_dir() {
curl_retry_on_18() {
local ec=18;
local attempts=0;
while [[ $ec -eq 18 && $attempts -lt 3 ]]; do
((attempts++))
while (( ec == 18 && attempts++ < 3 )); do
curl "$@" # -C - would return code 33 if unsupported by server
ec=$?
done
Expand Down

0 comments on commit e3867d9

Please sign in to comment.