From f5593692885c7401195a6907339ea1d03df95c35 Mon Sep 17 00:00:00 2001 From: ganeshvanahalli Date: Mon, 16 Oct 2023 10:46:04 -0500 Subject: [PATCH] refactor --- .github/workflows/waitForNitro.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/waitForNitro.sh b/.github/workflows/waitForNitro.sh index add83e24bc..cf3f6484fc 100755 --- a/.github/workflows/waitForNitro.sh +++ b/.github/workflows/waitForNitro.sh @@ -1,9 +1,9 @@ +#!/bin/bash # poll the nitro endpoint until we get a 0 return code or 30mins have passed, in that case exit 1 timeout_time=$(($(date +%s) + 1800)) while (( $(date +%s) <= timeout_time )); do - curl -X POST -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":45678,"method":"eth_chainId","params":[]}' 'http://localhost:8547' - if [ "$?" -eq "0" ]; then + if curl -X POST -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":45678,"method":"eth_chainId","params":[]}' 'http://localhost:8547'; then exit 0 else sleep 20