From 431180049742c63a6e4df0368dd6af86988990dd Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sat, 26 Aug 2023 15:39:53 -0500 Subject: [PATCH] Update services.inc --- inc/services.inc | 45 ++++++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/inc/services.inc b/inc/services.inc index 875e96f1..e6c8e82f 100755 --- a/inc/services.inc +++ b/inc/services.inc @@ -238,31 +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 + elif [ "${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 if [ "${3}" != "ns" ]; then