docker/tsig/tsig-key.sh

10 lines
265 B
Bash
Raw Normal View History

2021-01-09 18:06:20 +00:00
#!/usr/bin/bash
NAME=$(dnssec-keygen -a HMAC-SHA512 -b 512 -n HOST $1 2>/dev/null)
ENC_NAME=$(echo $NAME|base64 -w 0)
KEY=$(cat $NAME.key |base64 -w 0)
PRIVATE=$(cat $NAME.private |base64 -w 0)
echo "tsig:
- name: $ENC_NAME
key: $KEY
private: $PRIVATE"