dnsmanager/tools/json2bind9.cr

14 lines
232 B
Crystal

require "json"
require "../src/storage/zone.cr"
alias DSZ = DNSManager::Storage::Zone
if ARGV.size < 1
puts "usage: json2bind9 zone.json"
exit 0
end
domain = ARGV[0]
zone = DSZ.from_json (File.read domain)
zone.to_bind9 STDOUT