From 7cbbd46f51e9f8764040eca541874339c0642a09 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Tue, 1 Oct 2019 23:42:36 -0500 Subject: [PATCH] Update nodemgmt-scripts.sh --- nodemgmt-scripts.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index 9a88321c..3a41aeca 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -1374,11 +1374,14 @@ NODEUPDATE() { echo -e "${idsCL[LightGreen]}Updating All Nodes and Webservers${idsCL[Default]}" echo -e "${idsCL[LightGreen]}-------------------------------------------${idsCL[Default]}" nip=${MYSQLMANAGER} + if [[ $(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) == *"${nip}"* ]]; then + nip='localhost ' + fi c=0; cw=15; spc='' spc1=${cw}-7 until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done echo -en "Updating MySQL-Manager${spc}($nip)...${idsCL[Default]}" - ssh root@${MYSQLMANAGER} "nodemgmt update q" + ssh root@${nip} "nodemgmt update q" c=0; cw=13; spc='' spc1=${cw}-${#nip} until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done @@ -1390,10 +1393,8 @@ NODEUPDATE() { 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 + NCMD="ssh root@${nip}" c=0; cw=15; spc='' spc1=${cw}-${#NM_NODETYPES[$NTYPE]} until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done