diff --git a/Other/Approval/InfrastructureManagement/poll_endpoint.sh b/Other/Approval/InfrastructureManagement/poll_endpoint.sh index 5da6c2bb..bd22d8d7 100644 --- a/Other/Approval/InfrastructureManagement/poll_endpoint.sh +++ b/Other/Approval/InfrastructureManagement/poll_endpoint.sh @@ -43,6 +43,15 @@ PollInfrastructureManagement() { result=$(curl -X GET $OPTIONS "$1" --header "Authorization: Basic $AUTH" | jq -r '.approval_state') sleep $WAIT_TIME done + result=null + n=0 + while [ "$n" -lt 10 ] && [ -z "$result" ] + do + n=$(( n + 1 )) + printf "Empty result, rechecking... Approval Status: %s\n" $result + result=$(curl -X GET $OPTIONS "$1" --header "Authorization: Basic $AUTH" | jq -r '.approval_state') + sleep $WAIT_TIME + done printf "Approval Status: %s\n" $result printf $result > $FILE