This commit is contained in:
Para Dox
2025-04-12 11:45:19 +07:00
parent 4cd47f1d04
commit e8f8f8b0b2
6 changed files with 8 additions and 67 deletions

View File

@@ -16,7 +16,7 @@ if [ -n "$NO_SSL" ]; then
DOMAIN="${DOMAIN:-0.0.0.0}"
fi
pathlist=$(cat $BASEPATH/$1.yml | grep -oP "(?<=stripprefix\.prefixes).*\"" | cut -d'=' -f2- | sed 's/.$//')
pathlist=$(cat $BASEPATH/$1.yml | grep -oP "stripprefix\.prefixes.*?/\K[^\"]+")
for path in $pathlist; do
include=true
@@ -27,7 +27,7 @@ for path in $pathlist; do
done
if $include; then
RPC_URL="${PROTO:-https}://$DOMAIN$path"
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":["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