Browse Source
Fix dns_pdns.sh to use saved account conf
pull/5328/head
sahsanu
2 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
12 additions and
1 deletions
-
dnsapi/dns_pdns.sh
|
|
@ -1,4 +1,4 @@ |
|
|
|
#!/usr/bin/env sh |
|
|
|
#!/usr/bin/bash |
|
|
|
# shellcheck disable=SC2034 |
|
|
|
dns_pdns_info='PowerDNS Server API |
|
|
|
Site: PowerDNS.com |
|
|
@ -10,6 +10,7 @@ Options: |
|
|
|
PDNS_Ttl=60 Domain TTL. Default: "60". |
|
|
|
' |
|
|
|
|
|
|
|
|
|
|
|
DEFAULT_PDNS_TTL=60 |
|
|
|
|
|
|
|
######## Public functions ##################### |
|
|
@ -20,6 +21,11 @@ dns_pdns_add() { |
|
|
|
fulldomain=$1 |
|
|
|
txtvalue=$2 |
|
|
|
|
|
|
|
PDNS_Url="${PDNS_Url:-$(_readaccountconf_mutable PDNS_Url)}" |
|
|
|
PDNS_ServerId="${PDNS_ServerId:-$(_readaccountconf_mutable PDNS_ServerId)}" |
|
|
|
PDNS_Token="${PDNS_Token:-$(_readaccountconf_mutable PDNS_Token)}" |
|
|
|
PDNS_Ttl="${PDNS_Ttl:-$(_readaccountconf_mutable PDNS_Ttl)}" |
|
|
|
|
|
|
|
if [ -z "$PDNS_Url" ]; then |
|
|
|
PDNS_Url="" |
|
|
|
_err "You don't specify PowerDNS address." |
|
|
@ -73,6 +79,11 @@ dns_pdns_rm() { |
|
|
|
fulldomain=$1 |
|
|
|
txtvalue=$2 |
|
|
|
|
|
|
|
PDNS_Url="${PDNS_Url:-$(_readaccountconf_mutable PDNS_Url)}" |
|
|
|
PDNS_ServerId="${PDNS_ServerId:-$(_readaccountconf_mutable PDNS_ServerId)}" |
|
|
|
PDNS_Token="${PDNS_Token:-$(_readaccountconf_mutable PDNS_Token)}" |
|
|
|
PDNS_Ttl="${PDNS_Ttl:-$(_readaccountconf_mutable PDNS_Ttl)}" |
|
|
|
|
|
|
|
if [ -z "$PDNS_Ttl" ]; then |
|
|
|
PDNS_Ttl="$DEFAULT_PDNS_TTL" |
|
|
|
fi |
|
|
|