From 9e51872ece46f94cbea7f352b78df4ef6311cd5c Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Tue, 26 Mar 2019 23:51:46 -0500 Subject: [PATCH] Update nodemgmt-scripts.sh --- nodemgmt-scripts.sh | 61 +++++++++++++++------------------------------ 1 file changed, 20 insertions(+), 41 deletions(-) diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index 51434c3c..71391923 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -1415,48 +1415,27 @@ NODEUPDATE() { ${NCMD} "nodemgmt update q" echo -e "${idsCL[Green]}COMPLETE${idsCL[Default]}" echo - nid=1 - for nip in "${MYSQL_HOSTS[@]}"; do - if [[ $(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) == *"${nip}"* ]]; then - nip='localhost ' - NCMD='ssh root@localhost' - else - NCMD="ssh root@${nip}" - fi - echo -en "Updating MySQL-Node${nid} ($nip )... ${idsCL[Default]}" - ${NCMD} "nodemgmt update q" - echo -e "${idsCL[Green]}COMPLETE${idsCL[Default]}" - nid=`expr $nid + 1` + + + for NTYPE in "${NODE_TYPES[@]}"; do + nid=1 + var=${NTYPE}_HOSTS[@] + for nip in "${!var}"; do + if [[ $(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) == *"${nip}"* ]]; then + nip='localhost ' + NCMD='ssh root@localhost' + else + NCMD="ssh root@${nip}" + fi + echo -en "Updating ${NM_NODETYPES[$NTYPE]}-Node${nid} ($nip )... ${idsCL[Default]}" + # ${NCMD} "nodemgmt update q" + echo -e "${idsCL[Green]}COMPLETE${idsCL[Default]}" + nid=`expr $nid + 1` + done + echo done - echo - nid=1 - for nip in "${LB_HOSTS[@]}"; do - if [[ $(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) == *"${nip}"* ]]; then - nip='localhost ' - NCMD='ssh root@localhost' - else - NCMD="ssh root@${nip}" - fi - echo -en "Updating LB-Node${nid} ($nip)... ${idsCL[Default]}" - ${NCMD} "nodemgmt update q" - echo -e "${idsCL[Green]}COMPLETE${idsCL[Default]}" - nid=`expr $nid + 1` - done - echo - nid=1 - for nip in "${WEB_HOSTS[@]}"; do - if [[ $(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) == *"${nip}"* ]]; then - nip='localhost ' - NCMD='ssh root@localhost' - else - NCMD="ssh root@${nip}" - fi - echo -en "Updating Webserver-Node${nid} ($nip)... ${idsCL[Default]}" - ${NCMD} "nodemgmt update q" - echo -e "${idsCL[Green]}COMPLETE${idsCL[Default]}" - nid=`expr $nid + 1` - done - echo "" + + echo -e "${idsCL[Green]}All Nodes have been Updated.${idsCL[Default]}" echo "" }