diff options
author | makefu <github@syntax-fehler.de> | 2013-03-07 11:40:38 +0100 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2013-03-07 11:40:38 +0100 |
commit | 7fa8fb85b072f612adb322f8a02617e1bd737020 (patch) | |
tree | 683df8268baae71451633518aa7ff7ea258a4aa8 /retiolum/bin/find-supernodes | |
parent | dbe2d838ba6834788265029162b2dd7d82473335 (diff) | |
parent | ef4eb3189363f5cd9a33b43693322a68d3142979 (diff) |
Merge branch 'master' of github.com:krebscode/painload
Diffstat (limited to 'retiolum/bin/find-supernodes')
-rwxr-xr-x | retiolum/bin/find-supernodes | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/retiolum/bin/find-supernodes b/retiolum/bin/find-supernodes new file mode 100755 index 00000000..2c316d0e --- /dev/null +++ b/retiolum/bin/find-supernodes @@ -0,0 +1,21 @@ +#! /bin/dash +set -eu +cd /etc/tinc/retiolum/hosts +for name in ` + grep '^[[:space:]]*Address[[:space:]]*=' * | + cut -d: -f1 | sort | uniq +`; do + if eval "`sed -n ' + s/[[:space:]]\+//g + s/^\(Address\|Port\)=\(.*\)/\1="\${\1+\$\1\n}\2"/p + ' $name`"; then + port=${Port-655} + for host in $Address; do + if nc -zw 2 $host $port 2>/dev/null; then + echo "$name [('$host', $port)]" + fi & + done + wait + fi & +done +wait |