-
-
Save mitkot/1c6050f7b1e6e31f8dda to your computer and use it in GitHub Desktop.
Get a cidr range
This file contains 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 | |
require 'ipaddr' | |
begin | |
puts IPAddr.new(ARGV[0]).to_range.to_s.gsub(/\.\./,"-") | |
rescue | |
puts 'i.e.) $ cidr 192.168.1.0/24' | |
end | |
~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment