From a341f8488f73a38954e3953bb3d9945335747bca Mon Sep 17 00:00:00 2001 From: Bobby Billingsley Date: Wed, 10 May 2023 10:41:29 +0000 Subject: [PATCH 1/2] allow PDNS_NO_NOTIFY to contain [ no | false ] --- pdns_api.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pdns_api.sh b/pdns_api.sh index d86bcb5..cf95129 100755 --- a/pdns_api.sh +++ b/pdns_api.sh @@ -466,9 +466,12 @@ main() { # Perform requests for zone in "${!requests[@]}"; do request "PATCH" "${url}/${zone}" '{"rrsets": ['"${requests[${zone}]}"']}' - if [[ -z "${PDNS_NO_NOTIFY:-}" ]]; then + local noCaseMatch=$(shopt -p nocasematch) + shopt -s nocasematch + if [[ -z "${PDNS_NO_NOTIFY:-}" || "${PDNS_NO_NOTIFY}" =~ "no|false" ]]; then request "PUT" "${url}/${zone}/notify" '' fi + $noCaseMatch done # Wait the requested amount of seconds when deployed From 0a8f75572bdcb69b5a2cf4310c883e628f8126e8 Mon Sep 17 00:00:00 2001 From: theAsylum-dk Date: Wed, 3 Jan 2024 14:54:24 +0000 Subject: [PATCH 2/2] Now with a nice, silent shellcheck :) --- pdns_api.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pdns_api.sh b/pdns_api.sh index cf95129..3d0b7a3 100755 --- a/pdns_api.sh +++ b/pdns_api.sh @@ -466,9 +466,10 @@ main() { # Perform requests for zone in "${!requests[@]}"; do request "PATCH" "${url}/${zone}" '{"rrsets": ['"${requests[${zone}]}"']}' - local noCaseMatch=$(shopt -p nocasematch) + local noCaseMatch + noCaseMatch=$(shopt -p nocasematch) shopt -s nocasematch - if [[ -z "${PDNS_NO_NOTIFY:-}" || "${PDNS_NO_NOTIFY}" =~ "no|false" ]]; then + if [[ -z "${PDNS_NO_NOTIFY:-}" || "${PDNS_NO_NOTIFY}" =~ no|false ]]; then request "PUT" "${url}/${zone}/notify" '' fi $noCaseMatch