Created
October 13, 2020 23:39
-
-
Save blackknight36/db0c80b69dcb94d510422c16c7cd4c11 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
#!/usr/bin/env ruby | |
def check_server(url) | |
@output = %x(httping -c 1 -s -l -m #{url}).split() | |
return @output[-1].to_i | |
end | |
status = check_server('https://www.watters.ws/405.html') | |
puts "server down" if status != 200 | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment