Browse Source

Fix dns_pdns.sh to use saved account conf

pull/5328/head
sahsanu 1 month ago committed by GitHub
parent
commit
1aabb7d6de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 13
      dnsapi/dns_pdns.sh

13
dnsapi/dns_pdns.sh

@ -1,4 +1,4 @@
#!/usr/bin/env sh #!/usr/bin/bash
# shellcheck disable=SC2034 # shellcheck disable=SC2034
dns_pdns_info='PowerDNS Server API dns_pdns_info='PowerDNS Server API
Site: PowerDNS.com Site: PowerDNS.com
@ -10,6 +10,7 @@ Options:
PDNS_Ttl=60 Domain TTL. Default: "60". PDNS_Ttl=60 Domain TTL. Default: "60".
' '
DEFAULT_PDNS_TTL=60 DEFAULT_PDNS_TTL=60
######## Public functions ##################### ######## Public functions #####################
@ -20,6 +21,11 @@ dns_pdns_add() {
fulldomain=$1 fulldomain=$1
txtvalue=$2 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 if [ -z "$PDNS_Url" ]; then
PDNS_Url="" PDNS_Url=""
_err "You don't specify PowerDNS address." _err "You don't specify PowerDNS address."
@ -73,6 +79,11 @@ dns_pdns_rm() {
fulldomain=$1 fulldomain=$1
txtvalue=$2 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 if [ -z "$PDNS_Ttl" ]; then
PDNS_Ttl="$DEFAULT_PDNS_TTL" PDNS_Ttl="$DEFAULT_PDNS_TTL"
fi fi

Loading…
Cancel
Save