This commit is contained in:
2023-06-23 22:14:39 -05:00
parent f2b2437f48
commit 9c384b6d6a
3 changed files with 17 additions and 13 deletions

View File

@@ -451,6 +451,7 @@ SERVICE(){
fi
else
if [ "${4}" != "all" ]; then
for NTYPE in "${NODE_TYPES[@]}"; do
@@ -487,6 +488,10 @@ SERVICE(){
else
NTS=(${NODE_TYPES[*]})
fi
# if [ "${NODE_TYPE}" == "" ]; then
#
# fi
if [ "${3}" != "q" ]; then
if [ "${NM_SERVICES[${1}]}" = "" ]; then
@@ -509,7 +514,9 @@ SERVICE(){
fi
if [ "${1}" = "nginx" ] && [ "${NGINX_PATHS[${NODE_TYPE}]}" != "" ]; then
if [ "${1}" = "nginx" ]; then
[ "${NODE_TYPE}" != "" ] && [ "${NGINX_PATHS[${NODE_TYPE}]}" != "" ] &&
if [ "${2}" = "restart" ] || [ "${2}" = "reload" ]; then
if [ "${3}" != "ns" ]; then
if [ "${3}" != "q" ]; then
@@ -524,16 +531,11 @@ SERVICE(){
# ${PH_CMD} "echo -e \"Service ${1} ${2}\" >> ${NGINX_PATHS[${NODE_TYPE}]}/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}" = "true" ]; do
# checked="`${PH_CMD} \"ssh root@${nip} '[ -f ${NGINX_PATHS[${NODE_TYPE}]}/test.repl ] && cat -u ${NGINX_PATHS[${NODE_TYPE}]}/test.repl' | diff -q - ${NGINX_PATHS[${NODE_TYPE}]}/test.repl\"`"
# checked="`${PH_CMD} \"ssh root@${nip} '[ -f '${NGINX_PATHS[${NODE_TYPE}]}'/test.repl ] && [ $(expr $(date +%s) - $(stat -L --format %Y '${NGINX_PATHS[${NODE_TYPE}]}'/test.repl)) -le 10 ] && echo true'\"`"
checked="`${PH_CMD} ssh root@${nip} [ -f ${NGINX_PATHS[${NODE_TYPE}]}/test.repl ] && [ $(expr $(date +%s) - $(stat -L --format %Y ${NGINX_PATHS[${NODE_TYPE}]}/test.repl)) -le 90 ] && echo true`"
done
fi
if [ "${checkhost}" != "false" ] && [ "${nip}" != "${!NT_HOST}" ]; then
checked=false
until [ "${checked}" = "true" ]; do
checked="`${PH_CMD} ssh root@${nip} [ -f ${NGINX_PATHS[${NODE_TYPE}]}/test.repl ] && [ $(expr $(date +%s) - $(stat -L --format %Y ${NGINX_PATHS[${NODE_TYPE}]}/test.repl)) -le 90 ] && echo true`"
done
fi
done
${PH_CMD} rm -f ${NGINX_PATHS[${NODE_TYPE}]}/test.repl