Browse Source

Respect CURL_OPTS variable (#26)

Add PDNS_CURL_OPTS variable
pull/30/head
edo 10 months ago
committed by GitHub
parent
commit
5801dad54d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      README.md
  2. 4
      pdns_api.sh

3
README.md

@ -19,6 +19,9 @@ PDNS_WAIT=300 # Optional. Delay for when slaves are slow
PDNS_ZONES_TXT=zones.txt # Optional. File containing zones to use (see below).
PDNS_NO_NOTIFY=yes # Optional. Disable sending a notification after updating the zone.
PDNS_SUFFIX=v.example.com # Optional. When using a dedicated validation zone via CNAME redirection
PDNS_CURL_OPTS="-k" # Optional. Pass some options to curl
# CURL_OPTS variable will be used if PDNS_CURL_OPTS undefined
# To ignore CURL_OPTS you could set PDNS_CURL_OPTS to empty string
```
Configure the DNS hook by adding the following to your Dehydrated config:

4
pdns_api.sh

@ -132,6 +132,8 @@ load_config() {
# Check optional settings
[[ -n "${PDNS_PORT:-}" ]] || PDNS_PORT=8081
# Check if PDNS_CURL_OPTS is unset
[[ -n "${PDNS_CURL_OPTS+empty}" ]] || PDNS_CURL_OPTS=${CURL_OPTS:-}
}
# Load the zones from file
@ -164,7 +166,7 @@ request() {
# Perform the request
# This is wrappend in an if to avoid the exit on error
if ! res="$(curl -sSfL --stderr - --request "${method}" --header "${content_header}" --header "${api_header}" --data "${data}" "${url}")"; then
if ! res="$(curl ${PDNS_CURL_OPTS:-} -sSfL --stderr - --request "${method}" --header "${content_header}" --header "${api_header}" --data "${data}" "${url}")"; then
error=true
fi

Loading…
Cancel
Save