Created
March 7, 2014 00:42
-
-
Save ssig33/9402819 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
require 'net/http' | |
def denwa | |
puts 'DENWA KAKEMASU' | |
end | |
def check | |
uri = URI.parse ARGV[0] | |
http = Net::HTTP.new(uri.host, uri.port) | |
code = nil | |
http.start{ | |
res = http.head(uri.path == '' ? '/' : uri.path) | |
code = res.code | |
} | |
code | |
end | |
10.times{ | |
if check() == '200' | |
exit | |
end | |
sleep 10 | |
} | |
denwa() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment