dns/dns.sh
Simon Marsh 693079113d
All checks were successful
continuous-integration/drone/push Build is passing
major refactor
2025-01-16 09:34:11 +00:00

23 lines
632 B
Bash
Executable File

#!/bin/bash -e
###########################################################################
# invoke dnscontrol with api keys from vault
if ! vault token lookup >/dev/null 2>&1
then
echo >&2 'vault token lookup failed, are you logged in to vault ?'
exit 1
fi
keys=$(vault kv get -format=json \
-mount='burble.dn42/infra' \
dns/api-keys | \
jq .data.data)
export PDNS_API_KEY=$(jq -r .PDNS_API_KEY <<< "$keys")
export CLOUDFLARE_API_KEY=$(jq -r .CLOUDFLARE_API_KEY <<< "$keys")
dnscontrol "$@"
###########################################################################
# end of file