2024-02-07 12:10:18 -08:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# pdns-tools
|
|
|
|
# https://git.stack-source.com/msb/pdns-tools
|
|
|
|
# Copyright (c) 2024 Matthew Saunders Brown <matthewsaundersbrown@gmail.com>
|
|
|
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
|
|
|
|
|
|
# load include file
|
|
|
|
source /usr/local/sbin/pdns.sh
|
|
|
|
|
|
|
|
help()
|
|
|
|
{
|
|
|
|
echo "Check if Zone exists (and is associated with this server)."
|
|
|
|
echo ""
|
|
|
|
echo "usage: $thisfilename -z <zone> [-h]"
|
|
|
|
echo ""
|
|
|
|
echo " -h Print this help."
|
|
|
|
echo " -z <zone> Zone (domain name) check."
|
|
|
|
}
|
|
|
|
|
|
|
|
pdns:getoptions "$@"
|
|
|
|
|
|
|
|
# check for zone
|
|
|
|
if [[ -z $zone ]]; then
|
|
|
|
echo "zone is required"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
SEARCH=($(/usr/local/bin/vdns-zone-lst.sh -q $zone))
|
2024-02-12 10:46:49 -08:00
|
|
|
if [[ ${#SEARCH[@]} = 2 ]]; then
|
|
|
|
if [[ "${SEARCH[1]}" = $zone ]]; then
|
2024-02-07 12:10:18 -08:00
|
|
|
echo true
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo false
|
|
|
|
exit 1
|