From 8145810b5666ca9fb3440e40d5811eaf2d3460f4 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sat, 9 Sep 2023 21:09:13 -0500 Subject: [PATCH] Update services.inc --- inc/services.inc | 36 +++--------------------------------- 1 file changed, 3 insertions(+), 33 deletions(-) diff --git a/inc/services.inc b/inc/services.inc index e6c8e82f..8d348659 100755 --- a/inc/services.inc +++ b/inc/services.inc @@ -211,10 +211,8 @@ SERVICE(){ fi - if [ "${1}" = "nginx" ] && ([ "${3}" == "" ] || [ "${3}" == "all" ]); then - # [ "${RUN_NODE_TYPE}" != "" ] && [ "${NM_REPL_NGINX_PATHS[${RUN_NODE_TYPE}]}" != "" ] && - - if [ "${2}" = "restart" ] || [ "${2}" = "reload" ]; then + if [ "${1}" = "nginx" ] && ([ "${3}" == "" ] || [ "${3}" == "all" ]); then + if [ "${RUN_NODE_TYPE}" != "" ] && [ "${NM_REPL_NGINX_PATHS[${RUN_NODE_TYPE}]}" != "" ] && ([ "${2}" = "restart" ] || [ "${2}" = "reload" ]); then if [ "${3}" != "ns" ]; then if [ "${3}" != "q" ]; then echo -en "${idsCL[LightYellow]}Verifying replication across the nodes... ${idsCL[Default]}" @@ -249,7 +247,7 @@ SERVICE(){ else PH_CMD="ssh root@${!NT_HOST}" fi - ${PH_CMD} touch /etc/powerdns/test.repl + ${PH_CMD} touch ${NM_REPL_CHECK_LOC[${1}]}/test.repl for nip in "${!NT_HOSTS}"; do checkhost=$(CHECK_HOST ${nip}) if [ "${checkhost}" != "false" ] && [ "${nip}" != "${!NT_HOST}" ]; then @@ -262,34 +260,6 @@ SERVICE(){ ${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 - if [ "${3}" != "q" ]; then - echo -en "${idsCL[LightYellow]}Verifying Apache config and ssl cert replication across the nodes... ${idsCL[Default]}" - fi - if [[ "${RUN_NODE_IP}" == *"${!NT_HOST}"* ]]; then - PH_CMD="ssh root@localhost" - else - PH_CMD="ssh root@${!NT_HOST}" - fi - echo "HERE: '$PH_CMD'" - - ${PH_CMD} "echo -e \"Service ${1} ${2}\" > /etc/apache2/test.repl" - for nip in "${!NT_HOSTS}"; do - checkhost=$(CHECK_HOST ${nip}) - if [ "${checkhost}" != "false" ]; then - if [ "${nip}" != "${!NT_HOST}" ]; then - checked=false - until [ "${checked}" = "" ]; do - checked="`${PH_CMD} \"ssh root@${nip} 'if [ -f /etc/apache2/test.repl ]; then cat /etc/apache2/test.repl; fi' | diff - /etc/apache2/test.repl\"`" - done - fi - fi - done - ${PH_CMD} rm -f /etc/apache2/test.repl - fi - fi fi if [ "${3}" != "q" ]; then echo -e "${idsCL[Green]}Completed${idsCL[Default]}"