From 50b06ac8c0565a7d5c6221238d21de82258f234e Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Wed, 15 Nov 2017 18:51:17 +0100 Subject: [PATCH] Cosmetics --- bin/backup_pgsql.sh | 2 +- bin/get-pdns-info | 27 +++++++++++++++++++++++---- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/bin/backup_pgsql.sh b/bin/backup_pgsql.sh index 19127ab..753b3db 100755 --- a/bin/backup_pgsql.sh +++ b/bin/backup_pgsql.sh @@ -174,7 +174,7 @@ if [[ "${REMOVE_OLD_BACKUP}" == 'YES' && -d "${REMOVED_BACKUP_DIR}" ]]; then ${SUDO}rm -rf ${REMOVED_BACKUP_DIR} 2>&1 | ${SUDO}tee -a ${LOGFILE} fi -echo "* Backup log: ${LOGFILE}:" +echo "* Backup log: '${LOGFILE}'" # vim: ts=4 et list diff --git a/bin/get-pdns-info b/bin/get-pdns-info index 8ec2fa3..b78826d 100755 --- a/bin/get-pdns-info +++ b/bin/get-pdns-info @@ -232,9 +232,9 @@ error() { } #------------------------------------------------------------------------------ -show_zones() { +list_zones() { - echo "${TITLE} - all zones" + info "${TITLE} - all zones" local url="http://${PDNS_SERVER}:${API_PORT}/api/v1/servers/localhost/zones" debug "Calling URL '${url}' ..." @@ -242,6 +242,25 @@ show_zones() { } +#------------------------------------------------------------------------------ +show_zones() { + + info "${TITLE} - records of zones" + echo + + local zone= + for zone in "${ZONES[@]}" ; do + + info "Zone '${GREEN}${zone}${NORMAL}'" + echo + local url="http://${PDNS_SERVER}:${API_PORT}/api/v1/servers/localhost/zones/${zone}." + debug "Calling URL '${url}' ..." + curl --silent --show-error -H "X-API-Key: ${API_KEY}" "${url}" | jq --sort-keys . || true + + done + +} + ################################################################################ ## @@ -255,9 +274,9 @@ main() { get_options "$@" if [[ "${#ZONES[*]}" != "0" ]] ; then - show_records - else show_zones + else + list_zones fi echo -- 2.39.5