Skip to content

Instantly share code, notes, and snippets.

@ssig33
Created March 7, 2014 00:42
Show Gist options
  • Save ssig33/9402819 to your computer and use it in GitHub Desktop.
Save ssig33/9402819 to your computer and use it in GitHub Desktop.
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