This file contains 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 ruby | |
require 'socket' | |
require 'timeout' | |
unless ARGV.length == 2 | |
abort "Usage: ruby #{__FILE__} HOST PORT" | |
end | |
def port_open?(ip, port, seconds=1) | |
# => checks if a port is open or not on a remote host | |
Timeout::timeout(seconds) do |