Created
March 3, 2014 22:59
-
-
Save vertis/9336423 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import sys | |
| from netaddr import IPNetwork | |
| from subprocess import call | |
| cidr = len(sys.argv) == 3 and sys.argv[2] or '24' | |
| if sys.argv[1]: | |
| ips = list(IPNetwork(sys.argv[1] + '/' + cidr))[1:-1] | |
| for ip in ips: | |
| print 'Trying connection to: ' + str(ip) | |
| call(['serf', 'join', str(ip)]) | |
| else: | |
| print 'Usage: serf-findpeers <myip>' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment