Add a tool for debug purposes: json2bind9
This commit is contained in:
parent
891be61722
commit
d1f890f869
13
tools/json2bind9.cr
Normal file
13
tools/json2bind9.cr
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
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
|
Loading…
Reference in New Issue
Block a user