diff --git a/link-devices b/link-devices index 2de7b84..11562ac 100755 --- a/link-devices +++ b/link-devices @@ -42,7 +42,7 @@ do fi done -curl -s -o /dev/null -X POST \ +curl -s -o /dev/null --retry 10 --retry-all-errors --retry-delay 10 -X POST \ 'http://iot-agent:4041/iot/devices' \ -H 'Content-Type: application/json' \ -H 'fiware-service: openiot' \ @@ -74,7 +74,7 @@ do fi done -curl -s -o /dev/null -X POST \ +curl -s -o /dev/null --retry 10 --retry-all-errors --retry-delay 10 -X POST \ 'http://iot-agent:4041/iot/devices' \ -H 'Content-Type: application/json' \ -H 'fiware-service: openiot' \ diff --git a/services b/services index caa4554..a3e596f 100755 --- a/services +++ b/services @@ -126,9 +126,9 @@ waitForMongo () { waitForIoTAgent () { echo -e "\n⏳ Waiting for \033[1;36mIoT-Agent\033[0m to be available\n" - while [ "$(docker run --network fiware_default --rm quay.io/curl/curl:${CURL_VERSION} -s -o /dev/null -w %{http_code} 'http://iot-agent:4041/version')" -eq 000 ] + while ! [ "$(docker inspect --format='{{.State.Health.Status}}' fiware-iot-agent 2>/dev/null)" == "healthy" ] do - echo -e "IoT Agent HTTP state: " $(curl -s -o /dev/null -w %{http_code} 'http://localhost:4041/version') " (waiting for 200)" + echo -e "IoT Agent health: $(docker inspect --format='{{.State.Health.Status}}' fiware-iot-agent 2>/dev/null) (waiting for healthy)" sleep 6 done }