This commit is contained in:
Sebastian
2024-09-24 07:26:48 +02:00
parent e7d371cd2f
commit 7f9d5200ef

15
network-to-config.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
# Check if JSON file is provided
if [ -z "$1" ]; then
echo "Usage: $0 <key1> [key2 ...]"
exit 1
fi
BASEPATH="$(dirname "$0")"
JSON_FILE="$BASEPATH/reference-rpc-endpoint.json"
shift
# Extract values under 'default' or 'archive' attributes for given keys
jq --argfile input "$JSON_FILE" '. as $in | ($IN.input | select(has("default")) | .default[]) + ($IN.input | select(has("archive")) | .archive[])' "$@"