diff options
author | kaotisk <kaotisk@arching-kaos.org> | 2024-12-12 18:39:50 +0200 |
---|---|---|
committer | kaotisk <kaotisk@arching-kaos.org> | 2024-12-12 18:39:50 +0200 |
commit | 0cdae0832a3355d4dbac934b270c097eeedbaf09 (patch) | |
tree | 3d849a216f9f1d0c4f31e3bc68e5aaa4f26bbb0c /lib/_ak_network | |
parent | 15e7a3d7c50051bb40f005108cc9429e55a62302 (diff) | |
download | arching-kaos-tools-0cdae0832a3355d4dbac934b270c097eeedbaf09.tar.gz arching-kaos-tools-0cdae0832a3355d4dbac934b270c097eeedbaf09.tar.bz2 arching-kaos-tools-0cdae0832a3355d4dbac934b270c097eeedbaf09.zip |
Check first
Diffstat (limited to 'lib/_ak_network')
-rwxr-xr-x | lib/_ak_network | 39 |
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(){ |