From 800f147d8f94c4ab867a483d1fba480c7e978e84 Mon Sep 17 00:00:00 2001 From: Matthew Saunders Brown Date: Tue, 8 Aug 2023 13:40:24 -0700 Subject: [PATCH] fix funcion names, use pdns prefix instead of vmail --- bin/pdns-zone-add.sh | 2 +- bin/pdns.sh | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bin/pdns-zone-add.sh b/bin/pdns-zone-add.sh index db49f1f..d97f2cd 100755 --- a/bin/pdns-zone-add.sh +++ b/bin/pdns-zone-add.sh @@ -110,7 +110,7 @@ elif [[ $zone_status = 404 ]]; then rr_content=${recordArray[2]} # munge data as needed - if vmail::validate_domain $rr_content; then + if pdns::validate_domain $rr_content; then rr_content="$rr_content." fi if [[ $rr_type = TXT ]]; then diff --git a/bin/pdns.sh b/bin/pdns.sh index 765cb27..4b3fd93 100755 --- a/bin/pdns.sh +++ b/bin/pdns.sh @@ -71,7 +71,7 @@ readonly zone_defaults_pri='0' # functions # crude but good enough domain name format validation -function vmail::validate_domain () { +function pdns::validate_domain () { local my_domain=$1 if [[ $my_domain =~ ^(([a-zA-Z0-9](-?[a-zA-Z0-9])*)\.)+[a-zA-Z]{2,}\.?$ ]] ; then return 0 @@ -83,9 +83,9 @@ function vmail::validate_domain () { # yesno prompt # # Examples: -# loop until y or n: if vmail::yesno "Continue?"; then -# default y: if vmail::yesno "Continue?" Y; then -# default n: if vmail::yesno "Continue?" N; then +# loop until y or n: if pdns::yesno "Continue?"; then +# default y: if pdns::yesno "Continue?" Y; then +# default n: if pdns::yesno "Continue?" N; then function pdns::yesno() { local prompt default reply @@ -137,7 +137,7 @@ function pdns:getoptions () { if [[ ${zone: -1} = '.' ]]; then zone=${zone::-1} fi - if ! vmail::validate_domain $zone; then + if ! pdns::validate_domain $zone; then echo "ERROR: $zone is not a valid domain name." exit fi @@ -148,7 +148,7 @@ function pdns:getoptions () { if [[ ${zone: -1} = '.' ]]; then zone=${zone::-1} fi - if ! vmail::validate_domain $zone; then + if ! pdns::validate_domain $zone; then echo "ERROR: $zone is not a valid domain name." exit fi