Skip to content

Commit

Permalink
do not grab file each time
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Apr 1, 2021
1 parent c2c96ba commit 7eb91a4
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions iam-saml/bin/external_get-saml-metadata.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,16 @@ then
mkdir -p $OUTDIR
fi

URL="${URL_PREFIX}${SELECT}"
curl -q -k $URL > $OUTPUT
status=$?
# if output file exists, do not re-run this

if [ ! -r $OUTPUT ]
then
URL="${URL_PREFIX}${SELECT}"
curl -q -k $URL > $OUTPUT
status=$?
else
status=0
fi
result=$(cat $OUTPUT)

jq -n --arg output_file "$OUTPUT" --arg value "$result" --arg status "$status" '{"output_file":$output_file,"value":$value,"status":$status}'

0 comments on commit 7eb91a4

Please sign in to comment.