Created
June 24, 2024 17:38
-
-
Save catwith1hat/48a03f24df648d9ae44feba5ce65e7d0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
while getopts ":d:" opt; do | |
case ${opt} in | |
d ) | |
DEPOSIT_JSON=$OPTARG | |
;; | |
\? ) | |
echo "Invalid option: $OPTARG" 1>&2 | |
;; | |
: ) | |
echo "Invalid option: $OPTARG requires an argument" 1>&2 | |
;; | |
esac | |
done | |
shift $((OPTIND -1)) | |
if [ -z "$DEPOSIT_JSON" ]; then | |
echo "Usage: $0 -d <deposit.json> <pubkey_1> <pubkey_2> ..." | |
exit -1 | |
fi | |
PUBKEYS="false" | |
for i in "$@"; do | |
PUBKEYS+=" or .pubkey==\"$i\"" | |
done | |
cat "$DEPOSIT_JSON" | jq "map(select($PUBKEYS))" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment