2022-01-21 13:38:32 -08:00
|
|
|
#!/bin/bash
|
2022-08-22 13:45:17 -07:00
|
|
|
#
|
|
|
|
# powerdns-tools
|
|
|
|
# https://git.stack-source.com/msb/powerdns-tools
|
|
|
|
# Copyright (c) 2022 Matthew Saunders Brown <matthewsaundersbrown@gmail.com>
|
|
|
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
2022-01-21 13:38:32 -08:00
|
|
|
|
2022-08-29 15:38:59 -07:00
|
|
|
DEBIAN_FRONTEND=noninteractive apt-get -y install pip
|
2022-03-28 09:53:19 -07:00
|
|
|
pip install certbot-dns-powerdns
|
|
|
|
|
2024-02-06 10:31:16 -08:00
|
|
|
# Install dasel from binary. Used to convert json data to csv
|
|
|
|
wget --quiet --output-document=/usr/local/bin/dasel https://github.com/TomWright/dasel/releases/download/v2.5.0/dasel_linux_amd64
|
|
|
|
chmod 755 /usr/local/bin/dasel
|
|
|
|
# one liner to automatically get latest version. could also be used to update existing install
|
|
|
|
# curl -sSLf "$(curl -sSLf https://api.github.com/repos/tomwright/dasel/releases/latest | grep browser_download_url | grep linux_amd64 | grep -v .gz | cut -d\" -f 4)" -L -o /usr/local/bin/dasel && chmod +x /usr/local/bin/dasel
|
|
|
|
|
2022-03-28 09:53:19 -07:00
|
|
|
if [[ ! -f /root/.pdns-credentials.ini ]]; then
|
|
|
|
echo "certbot_dns_powerdns:dns_powerdns_api_url =" > /root/.pdns-credentials.ini
|
|
|
|
echo "certbot_dns_powerdns:dns_powerdns_api_key =" >> /root/.pdns-credentials.ini
|
|
|
|
chmod 640 /root/.pdns-credentials.ini
|
|
|
|
echo "Update /root/.pdns-credentials.ini with your settings (this is to be used with certbot-dns-powerdns)."
|
|
|
|
fi
|
|
|
|
|
2022-01-21 13:38:32 -08:00
|
|
|
chmod 755 bin/*
|
|
|
|
cp bin/* /usr/local/bin/
|
|
|
|
|
|
|
|
if [[ ! -f /usr/local/etc/pdns.conf ]]; then
|
|
|
|
cp etc/pdns.conf /usr/local/etc/pdns.conf
|
2022-03-28 09:53:19 -07:00
|
|
|
chmod 640 /usr/local/etc/pdns.conf
|
|
|
|
echo "Update /usr/local/etc/pdns.conf with your settings."
|
2022-01-21 13:38:32 -08:00
|
|
|
fi
|