forked from HKEOS/Ghostbusters-Testnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
verifyABPs.sh
26 lines (22 loc) · 870 Bytes
/
verifyABPs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
if [[ -f abp_list ]]; then
rm abp_list;
fi
for file in ~/kbfs/team/eos_ghostbusters/mesh/*.peer_info.signed; do
[ -e "$file" ] || continue;
kbuser=$(echo "$file" | sed -e 's/.*mesh\/\(.*\).peer_info.signed*/\1/');
cat "$file" | keybase verify -S "$kbuser" &>output;
out=$(<output);
err=$(echo "$out" | grep "ERR");
if [[ "$err" == "" ]]; then
echo "$kbuser";
peerdata=$(cat ~/kbfs/public/$kbuser/bp_info.json);
acc=$(echo "$peerdata" | jq -r ".producer_account_name");
pubkey=$(echo "$peerdata" | jq -r ".producer_public_key");
if [[ $acc != "" ]] && [[ $pubkey != "" ]]; then
echo "$acc,$pubkey" >> abp_list
fi
fi
done
echo -e "\n >> ABP List is ready!";
cat abp_list;