add -d (domain) option as alias to -z (zone)
This commit is contained in:
parent
0217028874
commit
8ba15ef4f0
13
bin/pdns.sh
13
bin/pdns.sh
|
@ -122,7 +122,7 @@ function pdns::yesno() {
|
||||||
|
|
||||||
function pdns:getoptions () {
|
function pdns:getoptions () {
|
||||||
local OPTIND
|
local OPTIND
|
||||||
while getopts "hbz:m:t:a:n:r:c:l:s:x" opt ; do
|
while getopts "hbz:d:m:t:a:n:r:c:l:s:x" opt ; do
|
||||||
case "${opt}" in
|
case "${opt}" in
|
||||||
h ) # display help and exit
|
h ) # display help and exit
|
||||||
help
|
help
|
||||||
|
@ -142,6 +142,17 @@ function pdns:getoptions () {
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
d ) # domain (alias of zone)
|
||||||
|
zone=${OPTARG,,}
|
||||||
|
# pdns stores zone name without trailing dot, remove if found
|
||||||
|
if [[ ${zone: -1} = '.' ]]; then
|
||||||
|
zone=${zone::-1}
|
||||||
|
fi
|
||||||
|
if ! vmail::validate_domain $zone; then
|
||||||
|
echo "ERROR: $zone is not a valid domain name."
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
;;
|
||||||
m ) # master - IP of master if this is a slave zone
|
m ) # master - IP of master if this is a slave zone
|
||||||
master=${OPTARG}
|
master=${OPTARG}
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user