This commit is contained in:
2023-07-04 00:19:33 -05:00
parent 23082b4429
commit d38a0be75d
3 changed files with 52 additions and 30 deletions

View File

@@ -440,7 +440,7 @@ SERVICE(){
if [ "${1}" = "nginx" ]; then
[ "${NODE_TYPE}" != "" ] && [ "${NGINX_PATHS[${NODE_TYPE}]}" != "" ] &&
[ "${NODE_TYPE}" != "" ] && [ "${NM_REPL_NGINX_PATHS[${NODE_TYPE}]}" != "" ] &&
if [ "${2}" = "restart" ] || [ "${2}" = "reload" ]; then
if [ "${3}" != "ns" ]; then
@@ -452,18 +452,18 @@ SERVICE(){
else
PH_CMD="ssh root@${!NT_HOST}"
fi
${PH_CMD} touch ${NGINX_PATHS[${NODE_TYPE}]}/test.repl
# ${PH_CMD} "echo -e \"Service ${1} ${2}\" >> ${NGINX_PATHS[${NODE_TYPE}]}/test.repl"
${PH_CMD} touch ${NM_REPL_NGINX_PATHS[${NODE_TYPE}]}/test.repl
# ${PH_CMD} "echo -e \"Service ${1} ${2}\" >> ${NM_REPL_NGINX_PATHS[${NODE_TYPE}]}/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 ${NGINX_PATHS[${NODE_TYPE}]}/test.repl ] && [ $(expr $(date +%s) - $(stat -L --format %Y ${NGINX_PATHS[${NODE_TYPE}]}/test.repl)) -le 90 ] && echo true`"
checked="`${PH_CMD} ssh root@${nip} [ -f ${NM_REPL_NGINX_PATHS[${NODE_TYPE}]}/test.repl ] && [ $(expr $(date +%s) - $(stat -L --format %Y ${NM_REPL_NGINX_PATHS[${NODE_TYPE}]}/test.repl)) -le 90 ] && echo true`"
done
fi
done
${PH_CMD} rm -f ${NGINX_PATHS[${NODE_TYPE}]}/test.repl
${PH_CMD} rm -f ${NM_REPL_NGINX_PATHS[${NODE_TYPE}]}/test.repl
fi
fi