You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
723 B

  1. # Kitten Info
  2. # Required Modules
  3. require "http/client"
  4. # Network Status
  5. client = HTTP::Client.new("google.com")
  6. # Set Timeouts to 1.5 seconds
  7. client.connect_timeout = 1.5
  8. client.dns_timeout = 1.5
  9. begin
  10. response = client.get("/")
  11. network = "Connected"
  12. rescue Socket::Error
  13. # Disconnect due to DNS error and usually no network access
  14. network = "Disconnected"
  15. rescue IO::Timeout
  16. # Network Timeout
  17. network = "Timeout"
  18. rescue errno
  19. # Disconnect due unreachable host
  20. network = "Disconnected"
  21. end
  22. # Architecture Command
  23. arch = `uname -m`
  24. # Print Information
  25. puts "Internet: " + network
  26. puts "Hostname: " + System.hostname
  27. puts "Archtecture: " + arch
  28. puts "Core Count: " + System.cpu_count.to_s