Jan Včelák wrote:
I agree that JSON is not very simple, but it is
definitelly secure and
deterministically parsable:
# Python
import json
with open("policy_default.json") as f:
data = json.load(f)
print("RRSIG lifetime: %d" % data["rrsig_lifetime"])
# Ruby
require 'json'
data = File.open("policy_default.json") do |f|
JSON.load(f)
end
puts "RRSIG lifetime: %d" % data["rrsig_lifetime"]
# Bash
(I give up... it won't be simple. But I can parse output of keymgr...)
$ sudo apt-get install jq
$ echo "RRSIG lifetime: $(jq .rrsig_lifetime < policy_default.json)"
:-)
--
Robert Edmonds
edmonds(a)debian.org