From 1fdde3bc8c2e671538b95a65f6f51b33cde589ac Mon Sep 17 00:00:00 2001 From: Sebastian <379651+czarly@users.noreply.github.com> Date: Fri, 13 Dec 2024 10:07:15 +0100 Subject: [PATCH] even better --- latest.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/latest.sh b/latest.sh index f4146782..d1b002c5 100755 --- a/latest.sh +++ b/latest.sh @@ -27,7 +27,11 @@ for path in $pathlist; do if curl -s -X POST $RPC_URL -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["latest",false],"id":1}' | jq -r '.result.number, .result.hash' | awk '{if (NR==1) print "Block Number:", strtonum($0); else print "Block Hash:", $0}'; then exit 0 else - curl -s -X POST $RPC_URL -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["latest",false],"id":1}' | jq + if curl -s -X POST $RPC_URL -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["latest",false],"id":1}' | jq; then + exit 1 + else + curl -vv -X POST $RPC_URL -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["latest",false],"id":1}' + fi fi fi done