fix funcion names, use pdns prefix instead of vmail

This commit is contained in:
Matthew Saunders Brown 2023-08-08 13:40:24 -07:00
parent d32c56685f
commit 800f147d8f
2 changed files with 7 additions and 7 deletions

View File

@ -110,7 +110,7 @@ elif [[ $zone_status = 404 ]]; then
rr_content=${recordArray[2]} rr_content=${recordArray[2]}
# munge data as needed # munge data as needed
if vmail::validate_domain $rr_content; then if pdns::validate_domain $rr_content; then
rr_content="$rr_content." rr_content="$rr_content."
fi fi
if [[ $rr_type = TXT ]]; then if [[ $rr_type = TXT ]]; then

View File

@ -71,7 +71,7 @@ readonly zone_defaults_pri='0'
# functions # functions
# crude but good enough domain name format validation # crude but good enough domain name format validation
function vmail::validate_domain () { function pdns::validate_domain () {
local my_domain=$1 local my_domain=$1
if [[ $my_domain =~ ^(([a-zA-Z0-9](-?[a-zA-Z0-9])*)\.)+[a-zA-Z]{2,}\.?$ ]] ; then if [[ $my_domain =~ ^(([a-zA-Z0-9](-?[a-zA-Z0-9])*)\.)+[a-zA-Z]{2,}\.?$ ]] ; then
return 0 return 0
@ -83,9 +83,9 @@ function vmail::validate_domain () {
# yesno prompt # yesno prompt
# #
# Examples: # Examples:
# loop until y or n: if vmail::yesno "Continue?"; then # loop until y or n: if pdns::yesno "Continue?"; then
# default y: if vmail::yesno "Continue?" Y; then # default y: if pdns::yesno "Continue?" Y; then
# default n: if vmail::yesno "Continue?" N; then # default n: if pdns::yesno "Continue?" N; then
function pdns::yesno() { function pdns::yesno() {
local prompt default reply local prompt default reply
@ -137,7 +137,7 @@ function pdns:getoptions () {
if [[ ${zone: -1} = '.' ]]; then if [[ ${zone: -1} = '.' ]]; then
zone=${zone::-1} zone=${zone::-1}
fi fi
if ! vmail::validate_domain $zone; then if ! pdns::validate_domain $zone; then
echo "ERROR: $zone is not a valid domain name." echo "ERROR: $zone is not a valid domain name."
exit exit
fi fi
@ -148,7 +148,7 @@ function pdns:getoptions () {
if [[ ${zone: -1} = '.' ]]; then if [[ ${zone: -1} = '.' ]]; then
zone=${zone::-1} zone=${zone::-1}
fi fi
if ! vmail::validate_domain $zone; then if ! pdns::validate_domain $zone; then
echo "ERROR: $zone is not a valid domain name." echo "ERROR: $zone is not a valid domain name."
exit exit
fi fi