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]}
|
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
|
||||||
|
|
12
bin/pdns.sh
12
bin/pdns.sh
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user