fix foir tron

This commit is contained in:
squidbear
2025-03-31 12:59:11 +02:00
parent 0a1c490e87
commit 24f12d7b94
2 changed files with 4 additions and 4 deletions

View File

@@ -29,13 +29,13 @@ for path in $pathlist; do
if $include; then if $include; then
RPC_URL="${PROTO:-https}://$DOMAIN$path" RPC_URL="${PROTO:-https}://$DOMAIN$path"
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' | 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":["latest",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 exit 0
else else
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 if curl -L -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 exit 1
else else
curl -vv -X POST $RPC_URL -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["latest",false],"id":1}' curl -L -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 fi
fi fi

View File

@@ -30,7 +30,7 @@ for path in $pathlist; do
RPC_URL="$PROTO://$DOMAIN$path" RPC_URL="$PROTO://$DOMAIN$path"
response_file=$(mktemp) response_file=$(mktemp)
http_status_code=$(curl --ipv4 -m 1 -s -X POST -w "%{http_code}" -o "$response_file" -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["latest", false],"id":1}' $RPC_URL) http_status_code=$(curl -L --ipv4 -m 1 -s -X POST -w "%{http_code}" -o "$response_file" -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["latest", false],"id":1}' $RPC_URL)
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then