Skip to content

Instantly share code, notes, and snippets.

@DiogoAndre
DiogoAndre / ping.rb
Last active January 3, 2024 09:08
Simple ICMP Ping script in Ruby. Using the Net-Ping gem https://github.com/djberg96/net-ping
require 'net/ping'
@icmp = Net::Ping::ICMP.new('142.40.81.34')
rtary = []
pingfails = 0
repeat = 5
puts 'starting to ping'
(1..repeat).each do
if @icmp.ping