cmdeploy: write --zonefile to file

This commit is contained in:
missytake 2023-12-13 04:58:51 +01:00
parent 4199e04ab3
commit 336f87770d

View File

@ -96,7 +96,6 @@ def dns_cmd_options(parser):
parser.add_argument( parser.add_argument(
"--zonefile", "--zonefile",
dest="zonefile", dest="zonefile",
action="store_true",
help="print the whole zonefile for deploying directly", help="print the whole zonefile for deploying directly",
) )
@ -156,7 +155,9 @@ def dns_cmd(args, out):
.strip() .strip()
) )
if args.zonefile: if args.zonefile:
print(zonefile) with open(args.zonefile, "w+") as zf:
zf.write(zonefile)
print(f"DNS records successfully written to: {args.zonefile}")
return return
started_dkim_parsing = False started_dkim_parsing = False
for line in zonefile.splitlines(): for line in zonefile.splitlines():