fix funcion names, use pdns prefix instead of vmail
This commit is contained in:
parent
d32c56685f
commit
800f147d8f
|
@ -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
|
||||
|
|
12
bin/pdns.sh
12
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
|
||||
|
|
Loading…
Reference in New Issue
Block a user