diff options
author | Your Name <you@example.com> | 2013-02-08 10:12:00 +0000 |
---|---|---|
committer | Your Name <you@example.com> | 2013-02-08 10:12:00 +0000 |
commit | 866a6db6f68fe4ccbfea4eb26b37dc5233b00c24 (patch) | |
tree | 733f6aad506ee9195653bf5d725b964879454b5d /retiolum/bin/find-supernodes | |
parent | ddd9f8791eea0e810682ab66d951571417ebc8d3 (diff) | |
parent | 194e1622b0b901780ceea40ea9c453c573b69995 (diff) |
Merge branch 'master' of https://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 |