From 22e7b41f609266e3504a1a043340fbba0d367e04 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sat, 26 Aug 2023 15:37:56 -0500 Subject: [PATCH] update --- defaults.inc | 2 +- inc/services.inc | 26 +++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/defaults.inc b/defaults.inc index d86bd7c3..e3b3644e 100755 --- a/defaults.inc +++ b/defaults.inc @@ -1,5 +1,5 @@ #!/usr/bin/env bash -VERS='4.11.12-08262023' +VERS='4.11.13-08262023' noheader=' service status-check nightlyrephp7.3-fpm,new backup report check checkcerts gitea update-nodes copynpmcerts singleservercheck update-dyndns backup-offsitepfsense ' CERT_DAEMON='/snap/bin/certbot' diff --git a/inc/services.inc b/inc/services.inc index 208e64b1..875e96f1 100755 --- a/inc/services.inc +++ b/inc/services.inc @@ -212,7 +212,7 @@ SERVICE(){ if [ "${1}" = "nginx" ] && ([ "${3}" == "" ] || [ "${3}" == "all" ]); then - [ "${RUN_NODE_TYPE}" != "" ] && [ "${NM_REPL_NGINX_PATHS[${RUN_NODE_TYPE}]}" != "" ] && + # [ "${RUN_NODE_TYPE}" != "" ] && [ "${NM_REPL_NGINX_PATHS[${RUN_NODE_TYPE}]}" != "" ] && if [ "${2}" = "restart" ] || [ "${2}" = "reload" ]; then if [ "${3}" != "ns" ]; then @@ -238,6 +238,30 @@ SERVICE(){ ${PH_CMD} rm -f ${NM_REPL_NGINX_PATHS[${RUN_NODE_TYPE}]}/test.repl fi fi + if [ "${1}" = "pdns" ] && ([ "${3}" == "" ] || [ "${3}" == "all" ]); then + if [ "${2}" = "restart" ] || [ "${2}" = "reload" ]; then + if [ "${3}" != "ns" ]; then + if [ "${3}" != "q" ]; then + echo -en "${idsCL[LightYellow]}Verifying replication across the nodes... ${idsCL[Default]}" + fi + if [[ "${RUN_NODE_IP}" == *"${!NT_HOST}"* ]]; then + PH_CMD="" + else + PH_CMD="ssh root@${!NT_HOST}" + fi + ${PH_CMD} touch /etc/powerdns/test.repl + for nip in "${!NT_HOSTS}"; do + checkhost=$(CHECK_HOST ${nip}) + if [ "${checkhost}" != "false" ] && [ "${nip}" != "${!NT_HOST}" ]; then + checked=false + until [ "${checked}" = "true" ]; do + checked="`${PH_CMD} ssh root@${nip} [ -f /etc/powerdns/test.repl ] && [ $(expr $(date +%s) - $(stat -L --format %Y /etc/powerdns/test.repl)) -le 90 ] && echo true`" + done + fi + done + ${PH_CMD} rm -f /etc/powerdns/test.repl + fi + fi elif [ "${1}" = "apache2-x" ]; then if [ "${2}" = "restart" ] || [ "${2}" = "reload" ]; then