From d87f1435c1ed0e02e0317662eb975b6bb874bb45 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Thu, 7 Feb 2019 10:15:10 -0600 Subject: [PATCH] Update nodemgmt-scripts.sh --- nodemgmt-scripts.sh | 41 ++++++++++++++++++----------------------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index 5ed95790..9e0bf184 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -56,8 +56,6 @@ STATUS() { # echo # nid=`expr $nid + 1` # done - declare -p REPL_CHECKS - declare -p REPL_DESC echo echo -e "${idsCL[Yellow]} Replication Status${idsCL[Default]}" DIVIDER true @@ -78,27 +76,24 @@ STATUS() { c=0; cw=20; spc='' spc1=${cw}-${#SUBJECT} until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done - - echo "${rcheck} - ${REPL_DESC[${rcheck}]} - ${REPL_CHECKS[${rcheck}]}" - - - # echo -en "${REPL_DESC[${rcheck}]}${spc}: " - # checked=false - # until [ "${checked}" = "" ]; do - # checked=`ssh root@${nip} "cat ${REPL_CHECKS[${rcheck}]}/test.repl" | diff - ${REPL_CHECKS[${rcheck}]}/test.repl` - # if [ "`date +%s`" -gt "$timeout" ]; then - # if [ "${STATUS_CHECK_EMAIL}" != "" ]; then - # echo "Timeout occurred in waiting for replication between nodes." | mail -s "Status-Check" ${STATUS_CHECK_EMAIL} - # fi - # timeout=true - # break - # fi - # done - # if [ "${timeout}" = "true" ]; then - # echo -e "${idsCL[Red]}Timeout${idsCL[Default]}" - # else - # echo -e "${idsCL[Green]}Good${idsCL[Default]}" - # fi + #echo "${rcheck} - ${REPL_DESC[${rcheck}]} - ${REPL_CHECKS[${rcheck}]}" + echo -en "${REPL_DESC[${rcheck}]}${spc}: " + checked=false + until [ "${checked}" = "" ]; do + checked=`ssh root@${nip} "cat ${REPL_CHECKS[${rcheck}]}/test.repl" | diff - ${REPL_CHECKS[${rcheck}]}/test.repl` + if [ "`date +%s`" -gt "$timeout" ]; then + if [ "${STATUS_CHECK_EMAIL}" != "" ]; then + echo "Timeout occurred in waiting for replication between nodes." | mail -s "Status-Check" ${STATUS_CHECK_EMAIL} + fi + timeout=true + break + fi + done + if [ "${timeout}" = "true" ]; then + echo -e "${idsCL[Red]}Timeout${idsCL[Default]}" + else + echo -e "${idsCL[Green]}Good${idsCL[Default]}" + fi done fi echo