Commit 6ca0ba20 authored by aoh's avatar aoh
Browse files

Add generate_key_example.py

parent 05ac9340
#!/bin/bash
echo $0 $1 $2 $3 $4 $5 $6 $7 $8 $9
#!/usr/bin/env python3
from db import DB
import subprocess
with DB() as d:
for id in d.get_domain_ids():
domain_name = d.get_domain_name(id)
for sid in d.get_subdomain_ids(id):
subdomain_name = d.get_subdomain_name(sid)
fqdn = subdomain_name + '.' + domain_name
command = './dnssec-keygen -r /dev/urandom -a HMAC-MD5 -b 512 -n HOST'
args = command.split(' ')
args += [fqdn]
with subprocess.Popen(args, stdout=subprocess.PIPE) as proc:
print(proc.stdout.read())
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment