vdns-stack/bin/vdns.sh
Matthew Saunders Brown f9c1038f79 initial commit
2024-02-22 15:02:16 -08:00

27 lines
801 B
Bash
Executable File

#!/bin/bash
#
# vdns-stack
# https://git.stack-source.com/msb/vdns-stack
# 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)
#
# vdns-stack include file, depends on and loads powerdns-tools
# Must be root, attempt sudo if need be. root is not actually required for the API commands, but we want to restrict access.
if [ "$USER" != "root" ]; then
exec sudo -u root $0 $@
fi
# check for and load pdns config
if [[ -f /usr/local/sbin/pdns.sh && -f /usr/local/etc/pdns.conf ]]; then
source /usr/local/sbin/pdns.sh
else
echo "ERROR: powerdns-tools must be installed and configured."
exit
fi
function vdns:getoptions () {
# just calls pdns getoptions
pdns:getoptions "$@"
}