Created
October 7, 2010 16:43
-
-
Save angelf/615429 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
| ips = ["192.168.166.142","192.168.166.144", "192.168.166.159", "192.168.166.160", "192.168.166.162", "192.168.166.164", "192.168.166.131", "192.168.166.137", "192.168.166.153", "192.168.166.163", "192.168.166.158"] | |
| etc_hosts_template = ' | |
| # | |
| 127.0.0.1 localhost | |
| 255.255.255.255 broadcasthost | |
| ::1 localhost | |
| %s vlex.com' | |
| ips.each do |ip| | |
| puts ip | |
| File.open("/etc/hosts", "w") {|fh| fh.write(etc_hosts_template % [ip])} | |
| 30.times do |i| | |
| puts i | |
| exit if (`curl -i "http://vlex.com/training_center" >& out; grep webrat out`).length > 0 | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment