From 8556bbcee78356a1dd8b2ac510e2b7664da37ebb Mon Sep 17 00:00:00 2001 From: goldsquid Date: Thu, 4 Sep 2025 20:36:25 +0700 Subject: [PATCH] fix --- latest.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/latest.sh b/latest.sh index 7010d821..98c4e42b 100755 --- a/latest.sh +++ b/latest.sh @@ -31,13 +31,13 @@ for path in $pathlist; do if $include; then RPC_URL="${PROTO:-https}://$DOMAIN/$path" - if curl -L -s -X POST $RPC_URL -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["${blocktag}",false],"id":1}' | jq -r '.result.number, .result.hash' | gawk '{if (NR==1) print "Block Number:", strtonum($0); else print "Block Hash:", $0}'; then + if curl -L -s -X POST $RPC_URL -H "Content-Type: application/json" --data "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockByNumber\",\"params\":[\"${blocktag}\",false],\"id\":1}" | jq -r '.result.number, .result.hash' | gawk '{if (NR==1) print "Block Number:", strtonum($0); else print "Block Hash:", $0}'; then exit 0 else - if curl -L -s -X POST $RPC_URL -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["${blocktag}",false],"id":1}' | jq; then + if curl -L -s -X POST $RPC_URL -H "Content-Type: application/json" --data "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockByNumber\",\"params\":[\"${blocktag}\",false],\"id\":1}" | jq; then exit 1 else - curl -L -vv -X POST $RPC_URL -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["${blocktag}",false],"id":1}' + curl -L -vv -X POST $RPC_URL -H "Content-Type: application/json" --data "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockByNumber\",\"params\":[\"${blocktag}\",false],\"id\":1}" fi fi fi