Update services.inc

This commit is contained in:
2023-09-09 21:09:13 -05:00
parent 5eb8d1bb08
commit 8145810b56

View File

@@ -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]}"