Last active
August 6, 2020 15:02
-
-
Save ejdyksen/066b9f5a1f60669477d355532d2fef4b to your computer and use it in GitHub Desktop.
A simple script to test if a website is responding to HTTP requests
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 ruby | |
loop do | |
good = 0 | |
bad = 0 | |
for i in 1..100 do | |
result = system("curl -sS https://www.google.com/ > /dev/null 2> /dev/null") | |
if result then | |
print "." | |
good = good + 1 | |
else | |
print "x" | |
bad = bad + 1 | |
end | |
end | |
puts | |
puts "Good: #{good}" | |
puts "Bad: #{bad}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment