Rob Austein 5 rokov pred
rodič
commit
edc47afc34
2 zmenil súbory, kde vykonal 30 pridanie a 2 odobranie
  1. 28 0
      README.md
  2. 2 2
      tsig-keygen.py

+ 28 - 0
README.md

@@ -0,0 +1,28 @@
+tsig-keygen.py
+==============
+
+```
+usage: tsig-keygen.py [-h] [-a {hmac-sha256,hmac-sha384,hmac-sha512}]
+                      [-d DIRECTORY] [-f {bind9,nsd}] [-k KEY] [-n NAME]
+                      [-o OUTPUT] [-s SERVERS [SERVERS ...]]
+                      [-z ZONES [ZONES ...]]
+
+Pure Python TSIG key generator with multiple output formats.
+
+optional arguments:
+  -h, --help            show this help message and exit
+  -a {hmac-sha256,hmac-sha384,hmac-sha512}, --algorithm {hmac-sha256,hmac-sha384,hmac-sha512}
+                        TSIG algorithm
+  -d DIRECTORY, --directory DIRECTORY
+                        where to store secondary zone files
+  -f {bind9,nsd}, --format {bind9,nsd}
+                        output format (default: nsd
+  -k KEY, --key KEY     TSIG shared secret (default: generate new secret)
+  -n NAME, --name NAME  DNS name for TSIG shared secret
+  -o OUTPUT, --output OUTPUT
+                        output file
+  -s SERVERS [SERVERS ...], --servers SERVERS [SERVERS ...]
+                        address(es) of primary nameserver(s)
+  -z ZONES [ZONES ...], --zones ZONES [ZONES ...]
+                        zone(s) to xfr from specified nameserver(s)
+```

+ 2 - 2
tsig-keygen.py

@@ -55,9 +55,9 @@ zone:
 ''')
 
 ap = argparse.ArgumentParser(description = __doc__)
-ap.add_argument("-a", "--algorithm", choices = algorithm_choices, default = algorithm_choices[0])
+ap.add_argument("-a", "--algorithm", choices = algorithm_choices, default = algorithm_choices[0], help = "TSIG algorithm")
 ap.add_argument("-d", "--directory", default = "secondary", help = "where to store secondary zone files")
-ap.add_argument("-f", "--format",    choices = tuple(templates), default = "nsd")
+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("-o", "--output",    default = "-", type = argparse.FileType("w"), help = "output file")