diff options
author | kaotisk <kaotisk@arching-kaos.org> | 2023-09-27 16:40:43 +0300 |
---|---|---|
committer | kaotisk <kaotisk@arching-kaos.org> | 2023-09-27 16:40:43 +0300 |
commit | 35b9daa63ac127e5a2a769cf96a56a0acd8da725 (patch) | |
tree | 99c9a3e2b40a15c3c84ecbd483a1aea68e796cd8 /bin/ak-cjdns-scanner | |
parent | 95063fc1bd293520d2c11cc8cc091dbf619505b4 (diff) | |
download | arching-kaos-tools-35b9daa63ac127e5a2a769cf96a56a0acd8da725.tar.gz arching-kaos-tools-35b9daa63ac127e5a2a769cf96a56a0acd8da725.tar.bz2 arching-kaos-tools-35b9daa63ac127e5a2a769cf96a56a0acd8da725.zip |
Got peers into the installation and configuration
Diffstat (limited to 'bin/ak-cjdns-scanner')
-rwxr-xr-x | bin/ak-cjdns-scanner | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/bin/ak-cjdns-scanner b/bin/ak-cjdns-scanner index b7dd53c..aee1fd2 100755 --- a/bin/ak-cjdns-scanner +++ b/bin/ak-cjdns-scanner @@ -6,17 +6,28 @@ # counter=0 printf '[' > walk.aknet -dumpLinks | cut -d ' ' -f 2,4 | sed 's/ /\n/g' | sort | uniq | while read -r ip || [ -n "$ip" ] +dumpLinks \ + | cut -d ' ' -f 2,4 \ + | sed 's/ /\n/g' \ + | sort \ + | uniq \ + | while read -r ip || [ -n "$ip" ] do - akid="`curl --connect-timeout 3 "http://[$(publictoip6 $ip)]:8610/v0/akid" 2>/dev/null`" + akid="`curl \ + -A 'akd/0.1.0; https://github.com/arching-kaos' \ + --connect-timeout 3 \ + "http://[$(publictoip6 $ip)]:8610/v0/akid" 2>/dev/null`" if [ "$?" == "0" ] then if [ "$counter" -ne "0" ] then printf ',' >> walk.aknet fi - printf '{"cjdnsPublicKey":"%s","cjdnsIp":"%s","akid":%s}' "$ip" "`publictoip6 $ip`" "$akid" >> walk.aknet + printf '{"cjdnsPublicKey":"%s","cjdnsIp":"%s","akid":%s}' \ + "$ip" "`publictoip6 $ip`" "$akid" >> walk.aknet counter="`expr $counter + 1`" fi done printf ']' >> walk.aknet + +mv walk.aknet $AK_ZPEERSFILE |