|
@@ -1,8 +1,6 @@
|
|
#!/usr/bin/env python
|
|
#!/usr/bin/env python
|
|
|
|
|
|
-"""
|
|
|
|
-Pure Python TSIG key generator with multiple output formats.
|
|
|
|
-"""
|
|
|
|
|
|
+"Pure Python TSIG key generator with multiple output formats."
|
|
|
|
|
|
import os, base64, argparse, jinja2
|
|
import os, base64, argparse, jinja2
|
|
|
|
|
|
@@ -55,14 +53,15 @@ zone:
|
|
''')
|
|
''')
|
|
|
|
|
|
ap = argparse.ArgumentParser(description = __doc__)
|
|
ap = argparse.ArgumentParser(description = __doc__)
|
|
-ap.add_argument("-a", "--algorithm", choices = algorithm_choices, default = algorithm_choices[0], help = "TSIG algorithm")
|
|
|
|
|
|
+ap.add_argument("-a", "--algorithm", choices = algorithm_choices, default = algorithm_choices[0],
|
|
|
|
+ help = "TSIG algorithm (default: " + algorithm_choices[0] + ")")
|
|
ap.add_argument("-d", "--directory", default = "secondary", help = "where to store secondary zone files")
|
|
ap.add_argument("-d", "--directory", default = "secondary", help = "where to store secondary zone files")
|
|
-ap.add_argument("-f", "--format", choices = tuple(templates), default = "nsd", help = "output format (default: nsd")
|
|
|
|
-ap.add_argument("-k", "--key", help = "TSIG shared secret (default: generate new secret)")
|
|
|
|
|
|
+ap.add_argument("-f", "--format", choices = tuple(templates), default = "nsd", help = "output format (default: nsd)")
|
|
|
|
+ap.add_argument("-k", "--key", help = "TSIG shared secret (default: generate new secret)")
|
|
ap.add_argument("-n", "--name", default = "tsig.example.org", help = "DNS name for TSIG shared secret")
|
|
ap.add_argument("-n", "--name", default = "tsig.example.org", help = "DNS name for TSIG shared secret")
|
|
ap.add_argument("-o", "--output", default = "-", type = argparse.FileType("w"), help = "output file")
|
|
ap.add_argument("-o", "--output", default = "-", type = argparse.FileType("w"), help = "output file")
|
|
-ap.add_argument("-s", "--servers", nargs = "+", default = [], help = "address(es) of primary nameserver(s)")
|
|
|
|
-ap.add_argument("-z", "--zones", nargs = "+", default = [], help = "zone(s) to xfr from specified nameserver(s)")
|
|
|
|
|
|
+ap.add_argument("-s", "--servers", nargs = "+", default = [], metavar = "SERVER", help = "address(es) of primary nameserver(s)")
|
|
|
|
+ap.add_argument("-z", "--zones", nargs = "+", default = [], metavar = "ZONE", help = "zone(s) to xfr from specified nameserver(s)")
|
|
args = ap.parse_args()
|
|
args = ap.parse_args()
|
|
|
|
|
|
if args.key is None:
|
|
if args.key is None:
|