aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2024-12-11 17:10:41 +0200
committerkaotisk <kaotisk@arching-kaos.org>2024-12-11 17:10:41 +0200
commit1ed619ea8d747f15987c99db10243d54f9a93a39 (patch)
treeafe303a276703345a45e72ada6764e6c2cba579b
parent620ad0b7ddf23fcdff21e18359899d09ab5f5140 (diff)
downloadarching-kaos-tools-1ed619ea8d747f15987c99db10243d54f9a93a39.tar.gz
arching-kaos-tools-1ed619ea8d747f15987c99db10243d54f9a93a39.tar.bz2
arching-kaos-tools-1ed619ea8d747f15987c99db10243d54f9a93a39.zip
Changed the way scans are performed so we can see a progress on each result output
-rwxr-xr-xlib/_ak_network24
1 files changed, 18 insertions, 6 deletions
diff --git a/lib/_ak_network b/lib/_ak_network
index 02e1d41..b3530b3 100755
--- a/lib/_ak_network
+++ b/lib/_ak_network
@@ -149,17 +149,23 @@ _ak_network_scan_cjdns_dump(){
TEMPDIR="$(_ak_make_temp_directory)"
AK_ZPEERSFILE="$HOME/.arching-kaos/peersFile"
cd $TEMPDIR
- counter=0
- printf '[' > walk.aknet
+ max="$(dumpLinks |wc -l)"
dumpLinks \
| cut -d ' ' -f 2,4 \
| sed 's/ /\n/g' \
| sort \
| uniq \
- | grep -v `dumpLinks | grep '0000\.0000\.0000\.0001' | cut -d ' ' -f 2` \
+ | grep -v `dumpLinks | grep '0000\.0000\.0000\.0001' \
+ | cut -d ' ' -f 2` > dumpedLinks
+ counter=0
+ count=0
+ max="$(cat dumpedLinks| wc -l)"
+ printf '[' > walk.aknet
+ cat dumpedLinks \
| while read -r ip || [ -n "$ip" ]
do
- _ak_log_debug "Scanning $(publictoip6 $ip)..."
+ count="$(( $count + 1 ))"
+ _ak_log_debug "Scanning [${count}/${max}] $(publictoip6 $ip)..."
node_info="$(curl \
--connect-timeout 3 \
-A 'akd/0.1.0; https://github.com/arching-kaos' \
@@ -218,13 +224,16 @@ _ak_network_scan_cjdns_full(){
grep -F "$line" $pubkeys_ips >> $filtered_online_pubkeys_ips
done
counter=0
+ count=0
+ max="$(cat $filtered_online_pubkeys_ips|wc -l)"
printf '[' > walk.aknet
cat $filtered_online_pubkeys_ips \
| sort \
| uniq \
| while read -r pkey ip || [ -n "$ip" ]
do
- _ak_log_debug "Scanning $ip..."
+ count="$(( $count + 1 ))"
+ _ak_log_debug "Scanning [${count}/${max}] $ip..."
node_info="$(curl \
--connect-timeout 3 \
-A 'akd/0.1.0; https://github.com/arching-kaos' \
@@ -270,13 +279,16 @@ _ak_network_scan_yggdrasil_full(){
exit 1
fi
counter=0
+ count=0
+ max="$(cat $pubkeys_ips|wc -l)"
printf '[' > walk.aknet
cat $pubkeys_ips \
| sort \
| uniq \
| while read -r pkey ip || [ -n "$ip" ]
do
- _ak_log_debug "Scanning $ip..."
+ count="$(( $count + 1 ))"
+ _ak_log_debug "Scanning [${count}/${max}] $ip..."
node_info="$(curl \
--connect-timeout 3 \
-A 'akd/0.1.0; https://github.com/arching-kaos' \