(1..254).each {|i| puts ": found 192.168.1.#{i}" if `ping 192.168.1.#{i} -c 1 -w 1`.match(/ttl/) }
require 'ping' #from core classes ip_prefix='192.168.1.' (1..254).each{|i| puts "Found #{ip_prefix}" if Ping.pingecho(ip_prefix+i.to_s,10) }
You need to create an account or log in to post comments to this site.