summaryrefslogtreecommitdiff
path: root/dht/vnet/gettcp.sh
diff options
context:
space:
mode:
Diffstat (limited to 'dht/vnet/gettcp.sh')
-rwxr-xr-xdht/vnet/gettcp.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/dht/vnet/gettcp.sh b/dht/vnet/gettcp.sh
new file mode 100755
index 00000000..7e9a9212
--- /dev/null
+++ b/dht/vnet/gettcp.sh
@@ -0,0 +1,7 @@
1#!/bin/bash
2sudo netstat -lnp | grep 'tcp.*dht' | \
3 awk '{ split($4,a,":"); port=a[length(a)]; pid=int($7) ; system ("readlink /proc/" pid "/cwd | sed s,$,\\ {tcp:" port "},") }' | \
4 sort | \
5 while read path port; do
6 ( cd $path ; ../dht ls | grep node-id |sed 's/ *node-id//; s/$/'$port/ )
7 done > ports.txt