Skip to content

Instantly share code, notes, and snippets.

@blackknight36
Created October 13, 2020 23:39
Show Gist options
  • Save blackknight36/db0c80b69dcb94d510422c16c7cd4c11 to your computer and use it in GitHub Desktop.
Save blackknight36/db0c80b69dcb94d510422c16c7cd4c11 to your computer and use it in GitHub Desktop.
#!/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