fix
This commit is contained in:
@@ -9,7 +9,7 @@ while IFS= read -r line; do
|
|||||||
blacklist+=("$line")
|
blacklist+=("$line")
|
||||||
done < "$BASEPATH/path-blacklist.txt"
|
done < "$BASEPATH/path-blacklist.txt"
|
||||||
|
|
||||||
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
|
for path in $pathlist; do
|
||||||
include=true
|
include=true
|
||||||
@@ -20,7 +20,7 @@ for path in $pathlist; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
if $include; then
|
if $include; then
|
||||||
RPC_URL="https://$DOMAIN$path"
|
RPC_URL="https://$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 --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)
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
BASEPATH="$(dirname "$0")"
|
|
||||||
source $BASEPATH/.env
|
|
||||||
|
|
||||||
IFS=':' read -ra parts <<< $COMPOSE_FILE
|
|
||||||
|
|
||||||
json=$(cat "$BASEPATH/reference-rpc-endpoint.json")
|
|
||||||
|
|
||||||
default_array=()
|
|
||||||
for key in $(jq -r 'keys[]' <<< "$json"); do
|
|
||||||
default_values=$(jq -r ".[\"$key\"].default[]" <<< "$json")
|
|
||||||
default_array+=($default_values)
|
|
||||||
|
|
||||||
for node in "${default_values[@]}"; do
|
|
||||||
size_in_gb=$($BASEPATH/restore-volumes.sh "$node" --print-size-only)
|
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
|
||||||
echo "$key;$node;$size_in_gb"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
done
|
|
||||||
|
|
||||||
@@ -16,7 +16,7 @@ if [ -n "$NO_SSL" ]; then
|
|||||||
DOMAIN="${DOMAIN:-0.0.0.0}"
|
DOMAIN="${DOMAIN:-0.0.0.0}"
|
||||||
fi
|
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
|
for path in $pathlist; do
|
||||||
include=true
|
include=true
|
||||||
@@ -27,7 +27,7 @@ for path in $pathlist; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
if $include; then
|
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
|
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
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
BASEPATH="$(dirname "$0")"
|
|
||||||
source $BASEPATH/.env
|
|
||||||
|
|
||||||
IFS=':' read -ra parts <<< $COMPOSE_FILE
|
|
||||||
|
|
||||||
blacklist=("drpc.yml" "drpc-free.yml" "base.yml" "rpc.yml" "monitoring.yml" "ftp.yml" "backup-http.yml")
|
|
||||||
|
|
||||||
for part in "${parts[@]}"; do
|
|
||||||
include=true
|
|
||||||
for word in "${blacklist[@]}"; do
|
|
||||||
if echo "$part" | grep -qE "$word"; then
|
|
||||||
#echo "The path $path contains a blacklisted word: $word"
|
|
||||||
include=false
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if $include; then
|
|
||||||
default=$(jq -r "to_entries[] | select(.value.default[]? == \"${part%.yml}\") | .key" $BASEPATH/reference-rpc-endpoint.json)
|
|
||||||
archive=$(jq -r "to_entries[] | select(.value.archive[]? == \"${part%.yml}\") | .key" $BASEPATH/reference-rpc-endpoint.json)
|
|
||||||
|
|
||||||
if [ -n "$archive" ]; then
|
|
||||||
echo "${archive}_archive"
|
|
||||||
elif [ -n "$default" ]; then
|
|
||||||
echo "${default}_default"
|
|
||||||
else
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -9,7 +9,7 @@ while IFS= read -r line; do
|
|||||||
blacklist+=("$line")
|
blacklist+=("$line")
|
||||||
done < "$BASEPATH/path-blacklist.txt"
|
done < "$BASEPATH/path-blacklist.txt"
|
||||||
|
|
||||||
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
|
for path in $pathlist; do
|
||||||
include=true
|
include=true
|
||||||
@@ -20,7 +20,7 @@ for path in $pathlist; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
if $include; then
|
if $include; then
|
||||||
RPC_URL="https://$DOMAIN$path"
|
RPC_URL="https://$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 --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")
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ else
|
|||||||
PROTO="https"
|
PROTO="https"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
pathlist=$(cat $BASEPATH/$1.yml | grep -oP "(?<=PathPrefix).*\"" | cut -d'`' -f2-2)
|
pathlist=$(cat $BASEPATH/$1.yml | grep -oP "stripprefix\.prefixes.*?/\K[^\"]+")
|
||||||
|
|
||||||
for path in $pathlist; do
|
for path in $pathlist; do
|
||||||
include=true
|
include=true
|
||||||
@@ -27,7 +27,7 @@ for path in $pathlist; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
if $include; then
|
if $include; then
|
||||||
RPC_URL="$PROTO://$DOMAIN$path"
|
RPC_URL="$PROTO://$DOMAIN/$path"
|
||||||
|
|
||||||
ref=''
|
ref=''
|
||||||
if [ -n "$2" ]; then
|
if [ -n "$2" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user