diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index a88e09fa..197adf2d 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -815,22 +815,19 @@ RUN_COMMAND(){ DIVIDER; echo -e "${idsST[Reset]}" NT_HOSTS=${NTYPE}_HOSTS[@] for nip in "${!NT_HOSTS}"; do - if [ "${RUN_NODE_IP}" == "${nip}" ]; then - NCMD='' - LH='- localhost' - else - NCMD="${SSHCMD} root@${nip}" - LH='' - fi - echo -e " ${idsST[Bold]}${idsCL[LightCyan]}${NM_HOSTNAMES[${nip}]}[${nip}]${idsST[Reset]} ${idsCL[LightYellow]}${LH}${idsCL[Default]}" - DIVIDER false green if [ ! -f /tmp/nmg.run.${nip} ]; then - + if [ "${RUN_NODE_IP}" == "${nip}" ]; then + NCMD='' + LH='- localhost' + else + NCMD="${SSHCMD} root@${nip}" + LH='' + fi + echo -e " ${idsST[Bold]}${idsCL[LightCyan]}${NM_HOSTNAMES[${nip}]}[${nip}]${idsST[Reset]} ${idsCL[LightYellow]}${LH}${idsCL[Default]}" + DIVIDER false green # echo "Running command: ${NCMD} ${RUNCMD}" [ "${NCMD}" != "" ] && ${NCMD} "${RUNCMD}" || ${RUNCMD} touch /tmp/nmg.run.${nip} - else - echo "Skipping, already ran command on this host" fi DIVIDER false green echo