-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstatus.sh
More file actions
executable file
·28 lines (21 loc) · 908 Bytes
/
status.sh
File metadata and controls
executable file
·28 lines (21 loc) · 908 Bytes
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
27
28
#!/bin/bash
# Use passed namespace, or default to 'bee-testnet'
NAMESPACE=${1:-bee-testnet}
DOMAIN=${2:-testnet.internal}
echo "Using namespace: $NAMESPACE with domain: $DOMAIN"
# Get list of ingress hosts/IPs matching "testnet.internal" in the given namespace
list=($(kubectl get ingress -n "$NAMESPACE" | grep "$DOMAIN" | awk '{print $3}'))
for i in ${!list[@]};
do
url=${list[$i]}
result=$(curl $url/status/peers -s)
# peers=( $(echo $result | jq -c '.snapshots[]') )
peers=( $(echo $result | jq -c '.snapshots[]') )
for j in ${!peers[@]};
do
peer=${peers[$j]}
echo $peer >> status.json
echo $url >> status.json
done
done
# ./scripts/status.sh bee-gateway && ./scripts/status.sh bee-storage && ./scripts/status.sh dev-bee-gateway && ./scripts/status.sh dev-bee-storage && ./scripts/status.sh bee-bootnode && ./scripts/status.sh dev-bee-bootnode