diff options
author | kaotisk <kaotisk@arching-kaos.org> | 2024-06-24 04:00:36 +0300 |
---|---|---|
committer | kaotisk <kaotisk@arching-kaos.org> | 2024-06-24 04:00:36 +0300 |
commit | 432acf6bf5cd42025a63266e77bacd8c5256c0a5 (patch) | |
tree | ef2ef8b80a9741f648f01e8a2f5c50da1f98b83b /bin/ak-cjdns-scanner | |
parent | 0c8f9f5ed254c923c368c8fa92d352f8da89b3ca (diff) | |
download | arching-kaos-tools-432acf6bf5cd42025a63266e77bacd8c5256c0a5.tar.gz arching-kaos-tools-432acf6bf5cd42025a63266e77bacd8c5256c0a5.tar.bz2 arching-kaos-tools-432acf6bf5cd42025a63266e77bacd8c5256c0a5.zip |
ak-network: script to handle connectivity
```bash
ak-network - AK Nettool
=======================
Network tools
Usage:
-h, --help Prints this help message
-s, --scan [ipfs|cjdns|stellar] Scan network(s) for peers
-c, --connect [ipfs|cjdns] Connect to network(s)
-p, --peers [ipfs|cjdns|stellar] Outputs peers found
1719190884 <ak> [ERROR] ak-network command finished (1)
```
Functions introduced or refactored:
- _ak_network_cjdns_scanner
- _ak_network_stellar_show_ids
- _ak_network_stellar_get_next_page
- _ak_network_stellar_proceed_to_next_page
- _ak_network_stellar_get_asset_holders
- _ak_network_scan_stellar
- _ak_network_scan_ipfs
- _ak_network_scan_cjdns
- _ak_network_scan
- _ak_network_show_peers_stellar
- _ak_network_show_peers_cjdns
- _ak_network_show_peers_ipfs
- _ak_network_show_peers
- _ak_network_ipfs_connect_bootstrap
- _ak_network_cjdns_connect
- _ak_network_cjdns_connect_bootstrap
- _ak_network_connect
Diffstat (limited to 'bin/ak-cjdns-scanner')
-rwxr-xr-x | bin/ak-cjdns-scanner | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/bin/ak-cjdns-scanner b/bin/ak-cjdns-scanner deleted file mode 100755 index 044670b..0000000 --- a/bin/ak-cjdns-scanner +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash -# -# Needs CJDNS tools in your PATH -# -# Ref: https://github.com/cjdelisle/cjdns -# -which dumpLinks > /dev/null 2>&1 -if [ $? -ne 0 ] -then - echo "You need to install cjdns and cjdns-tools" - exit 1 -fi - -which publictoip6 > /dev/null 2>&1 -if [ $? -ne 0 ] -then - echo "You need to install cjdns and cjdns-tools" - exit 1 -fi - -TEMPDIR="$(mktemp -d)" -AK_ZPEERSFILE="$HOME/.arching-kaos/peersFile" -cd $TEMPDIR -counter=0 -printf '[' > walk.aknet -dumpLinks \ - | cut -d ' ' -f 2,4 \ - | sed 's/ /\n/g' \ - | sort \ - | uniq \ - | while read -r ip || [ -n "$ip" ] -do - node_info="$(curl \ - --connect-timeout 3 \ - -A 'akd/0.1.0; https://github.com/arching-kaos' \ - "http://[$(publictoip6 $ip)]:8610/v0/node_info" 2>/dev/null | jq -c -M)" - if [ $? -eq 0 ] && [ $(echo -n "$node_info" | wc -c) -gt 0 ] - then - if [ "$counter" -ne "0" ] - then - printf ',' >> walk.aknet - fi - printf '{"cjdns":{"public_key":"%s","ip":"%s"},"node_info":%s}' \ - "$ip" "`publictoip6 $ip`" "$node_info" >> walk.aknet - counter="`expr $counter + 1`" - fi -done -printf ']' >> walk.aknet - -mv walk.aknet $AK_ZPEERSFILE - -rm -rf $TEMPDIR |