aboutsummaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorepoch <epoch@hacking.allowed.org>2020-04-02 03:24:18 -0500
committerepoch <epoch@hacking.allowed.org>2020-04-02 03:24:18 -0500
commit192c4437672ce7743f1e567b3fbf2ef7c9c4bbca (patch)
tree4831301fef6c30a6520c11e63105ce6686165707 /share
parent906c6c4a25fe0542c9741f49d4fcb74b5e5c39b8 (diff)
parent893df52f73ad082679ad2a5df42c1768e93ff791 (diff)
downloadhackvr-192c4437672ce7743f1e567b3fbf2ef7c9c4bbca.tar.gz
hackvr-192c4437672ce7743f1e567b3fbf2ef7c9c4bbca.zip
Merge branch 'master' of ssh://git.main.lv/hackvr
Diffstat (limited to 'share')
-rwxr-xr-xshare/hackvr/examples/anonet_map/map19
1 files changed, 16 insertions, 3 deletions
diff --git a/share/hackvr/examples/anonet_map/map b/share/hackvr/examples/anonet_map/map
index 13279ab..4dbbdbd 100755
--- a/share/hackvr/examples/anonet_map/map
+++ b/share/hackvr/examples/anonet_map/map
@@ -1,5 +1,18 @@
#!/bin/bash
-paths="$(ncat --recv-only 21.41.41.1 64777 | sort | uniq)"
+paths="$(ncat --recv-only 21.41.41.1 64777 | sort | uniq | tee ${PREFIX}/var/cache/hackvr/anonet_data.new)"
+
+MAP=${PREFIX}/var/cache/hackvr/anonet_map.hackvr
+
+#see if the data actually changed before regenerating this shit...
+if cmp ${PREFIX}/var/cache/hackvr/anonet_data.new ${PREFIX}/var/cache/hackvr/anonet_data.old ; then
+ cat $MAP
+ exit 0
+fi
+
+mv ${PREFIX}/var/cache/hackvr/anonet_data.new ${PREFIX}/var/cache/hackvr/anonet_data.old
+
+> $MAP
+
nodes=$(printf "%s\n" "$paths" | tr ' ' '\n' | sort | uniq)
nodes_count="$(printf "%s\n" "$nodes" | tr ' ' '\n' | wc -l | tr -cd '0-9')"
#echo $nodes
@@ -45,11 +58,11 @@ for node in $nodes;do
printf "<whois://whois.ano/AS* flatten\n"
makelabel.sh AS$node $( echo | awk "{print $(xcoord_by_ASN $node) * 13}" ) $( echo | awk "{print $(ycoord_by_ASN $node) * 13}" ) -10 <<< $node
printf "AS%s scale .1 .1 .1\n" "$node"
-done
+done | tee -a $MAP
for i in $edges;do
line_between_nodes "$i"
-done
+done | tee -a $MAP
#for i in ${!nodes[@]};do
# echo $i