aboutsummaryrefslogtreecommitdiff
path: root/lib/_ak_network
diff options
context:
space:
mode:
Diffstat (limited to 'lib/_ak_network')
-rwxr-xr-xlib/_ak_network39
1 files changed, 22 insertions, 17 deletions
diff --git a/lib/_ak_network b/lib/_ak_network
index 898ef44..39f0466 100755
--- a/lib/_ak_network
+++ b/lib/_ak_network
@@ -357,24 +357,29 @@ _ak_network_scan(){
_ak_network_show_peers_stellar(){
stellarParticipants="$AK_WORKDIR/stellar-network-participants"
stellarParticipantsOnline="$AK_WORKDIR/stellar-network-participants-online"
+ if [ -f "${stellarParticipantsOnline}" ]
+ then
(
- printf '['
- counter=0
- cat $stellarParticipantsOnline | while read stellarAddress akConfig
- do
- if [ $counter -ne 0 ]
- then
- printf ','
- fi
- counter=$(( $counter + 1 ))
- akConfigHash="$(_ak_ipfs_name_resolve /ipns/$akConfig|cut -d '/' -f 3)"
- printf '{"stellar":{"address":"%s","config":"%s"},"node_info":%s}' \
- "$stellarAddress" \
- "$akConfig" \
- "$(_ak_ipfs_cat $akConfigHash)"
- done
- printf ']'
- ) | sed -e 's/\[]//g' #| jq
+ printf '['
+ counter=0
+ cat $stellarParticipantsOnline | while read stellarAddress akConfig
+ do
+ if [ $counter -ne 0 ]
+ then
+ printf ','
+ fi
+ counter=$(( $counter + 1 ))
+ akConfigHash="$(_ak_ipfs_name_resolve /ipns/$akConfig|cut -d '/' -f 3)"
+ printf '{"stellar":{"address":"%s","config":"%s"},"node_info":%s}' \
+ "$stellarAddress" \
+ "$akConfig" \
+ "$(_ak_ipfs_cat $akConfigHash)"
+ done
+ printf ']'
+ ) | sed -e 's/\[]//g' #| jq
+ else
+ _ak_log_debug "No stellar peers found"
+ fi
}
_ak_network_show_peers_cjdns(){