From c4f6e0336ebd5e079ee440203e5a81ae4d3950f6 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sun, 1 Dec 2024 18:43:03 -0600 Subject: [PATCH] Update nodemgmt-scripts.sh --- nodemgmt-scripts.sh | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index 049f83bb..c68ed2c6 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -779,14 +779,18 @@ RUN_COMMAND(){ shift done if [ "${nodetype}" == "ALL" ] || [ -n ${nodetype} ]; then + echo 1 nodetype=ALL NT_HOSTS=ALL_HOSTS[@] NTS=(${NM_NODE_TYPES[*]}) elif [ "${nodetype}" != "" ]; then + echo 2 if [ "${NM_HOSTS[${nodetype}]}" != "" ]; then + echo 3 NT_HOSTS=${nodetype}_HOSTS[@] NTS=("${nodetype}"); else + echo 4 echo -e "${idsCL[Red]}"${nodetype}" is an unknown NodeType.${idsCL[Default]}" exit 1 fi @@ -795,24 +799,24 @@ RUN_COMMAND(){ echo "NODETYPE= '${nodetype}'" echo "RUNCMD= '${RUNCMD}'" - for NTYPE in "${NTS[@]}"; do - echo -e "${idsST[Bold]}"; DIVIDER - echo -e "${idsCL[Yellow]} ${NM_NODETYPES[$NTYPE]}-Nodes to run command { \`${RUNCMD}\` }${idsCL[Default]}" - DIVIDER; echo -e "${idsST[Reset]}" - - for nip in "${!NT_HOSTS}"; do - if [[ ${RUN_NODE_IP} == *"${nip}"* ]]; then NCMD=''; LH='- localhost' - else NCMD="ssh -q -o ConnectTimeout=3 -o ConnectionAttempts=1 root@${nip}"; LH='' - fi - echo -e " ${idsST[Bold]}${idsCL[LightCyan]}${NM_HOSTNAMES[${nip}]}[${nip}]${idsST[Reset]}${idsCL[LightCyan]} ${idsCL[LightYellow]}${LH}${idsCL[Default]}" - DIVIDER false green - echo "Running command: ${NCMD} ${RUNCMD}" - #${NCMD} "${RUNCMD}" - DIVIDER false green - echo - done - echo - done + # for NTYPE in "${NTS[@]}"; do + # echo -e "${idsST[Bold]}"; DIVIDER + # echo -e "${idsCL[Yellow]} ${NM_NODETYPES[$NTYPE]}-Nodes to run command { \`${RUNCMD}\` }${idsCL[Default]}" + # DIVIDER; echo -e "${idsST[Reset]}" + # + # for nip in "${!NT_HOSTS}"; do + # if [[ ${RUN_NODE_IP} == *"${nip}"* ]]; then NCMD=''; LH='- localhost' + # else NCMD="ssh -q -o ConnectTimeout=3 -o ConnectionAttempts=1 root@${nip}"; LH='' + # fi + # echo -e " ${idsST[Bold]}${idsCL[LightCyan]}${NM_HOSTNAMES[${nip}]}[${nip}]${idsST[Reset]}${idsCL[LightCyan]} ${idsCL[LightYellow]}${LH}${idsCL[Default]}" + # DIVIDER false green + # echo "Running command: ${NCMD} ${RUNCMD}" + # #${NCMD} "${RUNCMD}" + # DIVIDER false green + # echo + # done + # echo + # done } DOWNLIST(){