diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index 99023c56..00bd1492 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -780,18 +780,14 @@ RUN_COMMAND(){ done echo "NODETYPE1= '${nodetype}'" if [ "${nodetype}" == "ALL" ] || [ -z ${nodetype+x} ]; 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 @@ -800,24 +796,24 @@ RUN_COMMAND(){ echo "NODETYPE2= '${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(){