Sha256: 96eca0b21fa772b1f511096574e53c65c3c3a96b1740891a0dc72619a60f4fa7
Contents?: true
Size: 974 Bytes
Versions: 9
Compression:
Stored size: 974 Bytes
Contents
#!/usr/bin/env ruby require "wmap" # Executable to add seed entry into ring of the trust. I.E. the trusted domain or CIDR def print_usage puts "Program to add trust authority entry. Usage: trust [domain|CIDR]" end puts Wmap.banner print_usage Log_dir=File.dirname(__FILE__)+'/../logs/' Wmap.wlog("Execute the command: trust #{ARGV[0]}","trust",Log_dir+"wmap.log") dt=Wmap::DomainTracker.instance ct=Wmap::CidrTracker.new(:verbose=>false) abort "Incorrect program argument! Proper usage: trust [domain | netblock]" unless ARGV.length==1 && (dt.is_fqdn?(ARGV[0]) || ct.is_cidr?(ARGV[0])) puts "Start the baptizing process ..." # Add entry into the local repository if dt.is_domain?(ARGV[0]) result=dt.add(ARGV[0]) unless result.nil? dt.save! abort "Domain #{ARGV[0]} is successfully baptized!" end end dt=nil if ct.is_cidr?(ARGV[0]) result=ct.add(ARGV[0]) unless result.nil? ct.save! abort "Net block #{ARGV[0]} is successfully baptized!" end end ct=nil
Version data entries
9 entries across 9 versions & 1 rubygems