From 6b56e3e4d5ec68fc9ae487a6b8fc97834bcef08b Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Thu, 7 Feb 2019 11:55:58 -0600 Subject: [PATCH] Update nodemgmt-scripts.sh --- nodemgmt-scripts.sh | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index f46a3ab6..22b97db2 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -23,21 +23,18 @@ STATUS() { then NCMD='ssh root@10.5.10.51' else NCMD='' fi - for nip in "${NODE_HOSTS[@]}"; do - if [[ $(/sbin/ip -o -4 addr list ens192 | awk '{print $4}' | cut -d/ -f1) != *"${nip}"* ]]; then - for rcheck in "${REPL_CHECK[@]}"; do - ${NCMD} rm -f ${FOLDER}/test.repl - daterun=`date +%Y-%m-%d-%H-%M-%S` - if [ "${NCMD}" = "" ]; then - echo -e "iDS-Node${nid} (${nip})\n${daterun}" > ${FOLDER}/test.repl - else - ${NCMD} 'echo -e "iDS-Node${nid} (${nip})\n${daterun}" > ${FOLDER}/test.repl' - fi - yes | ${NCMD} cp -rfH ${FOLDER}/test.repl ${REPL_CHECKS[${rcheck}]}/test.repl - done + for rcheck in "${REPL_CHECK[@]}"; do + ${NCMD} rm -f ${FOLDER}/test.repl + daterun=`date +%Y-%m-%d-%H-%M-%S` + if [ "${NCMD}" = "" ]; then + echo -e "iDS-Node${nid} (${nip})\n${daterun}" > ${FOLDER}/test.repl + yes | cp -rfH ${FOLDER}/test.repl ${REPL_CHECKS[${rcheck}]}/test.repl + else + ${NCMD} "echo -e \"Status-Check (${NODE_HOSTNAME})\n${daterun}\" > ${FOLDER}/test.repl" + yes | ${NCMD} "cp -rfH ${FOLDER}/test.repl ${REPL_CHECKS[${rcheck}]}/test.repl" fi done - + echo -e "${idsST[Bold]}"; DIVIDER echo -e "${idsCL[Yellow]} Node Service Status${idsCL[Default]}" DIVIDER; echo -e "${idsST[Reset]}" @@ -101,7 +98,7 @@ STATUS() { if [ "${NCMD}" = "" ]; then checked=`ssh root@${nip} "cat ${REPL_CHECKS[${rcheck}]}/test.repl" | diff - ${REPL_CHECKS[${rcheck}]}/test.repl` else - ${NCMD} 'checked=`ssh root@${nip} "cat ${REPL_CHECKS[${rcheck}]}/test.repl" | diff - ${REPL_CHECKS[${rcheck}]}/test.repl`' + ${NCMD} "checked=`ssh root@${nip} \"cat ${REPL_CHECKS[${rcheck}]}/test.repl\" | diff - ${REPL_CHECKS[${rcheck}]}/test.repl`" fi if [ "`date +%s`" -gt "$timeout" ]; then if [ "${STATUS_CHECK_EMAIL}" != "" ]; then