From 381159a0d70b5645ffdc4ea056915f8e3e139de7 Mon Sep 17 00:00:00 2001 From: Sebastian <379651+czarly@users.noreply.github.com> Date: Fri, 13 Dec 2024 10:02:29 +0100 Subject: [PATCH] even better --- latest.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/latest.sh b/latest.sh index a45ece22..b4f99168 100755 --- a/latest.sh +++ b/latest.sh @@ -25,5 +25,9 @@ for path in $pathlist; do RPC_URL="https://$DOMAIN$path" 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}' + + if $? -ne 0; then + curl -s -X POST $RPC_URL -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["latest",false],"id":1}' | jq + fi fi done