Skip to content

Commit

Permalink
Added external_curl provider as default. Allowing 1 retry. Documentat…
Browse files Browse the repository at this point in the history
…ion of explanation/limitations.
  • Loading branch information
atrull committed Nov 19, 2023
1 parent b0b58ff commit 0cc084c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions external_curl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Exit if any of the intermediate steps fail
set -e

export BODY=`curl -s --retry $2 --connect-timeout $3 $1 || echo -n noresponse`
# Safely produce a JSON object containing the result value.
# jq will ensure that the value is properly quoted
# and escaped to produce a valid JSON string.
jq -n --arg BODY "$BODY" '{"body":$BODY}'

0 comments on commit 0cc084c

Please sign in to comment.