Update nodemgmt-scripts.sh

This commit is contained in:
2024-12-01 18:25:38 -06:00
parent 8ee58ffaeb
commit 32bb943ec6

View File

@@ -771,41 +771,43 @@ BACKUP_UNIFINVR(){
} }
RUN_COMMAND(){ RUN_COMMAND(){
RUNCMD=''
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
case "${1}" in case "${1}" in
-nt|-nodetype) nodetype=${2^^};; -nt|-nodetype) nodetype=${2^^};;
*) RUNCMD="${RUNCMD}${1} ";; -cmd) RUNCMD="${2}";;
esac esac
shift shift
done done
echo "NODETYPE= '${nodetype}'" if [ "${nodetype}" == "ALL" ] || ; then
echo "RUNCMD= '${RUNCMD}'" NT_HOSTS=ALL_HOSTS[@]
NTS=(${NM_NODE_TYPES[*]})
# for NTYPE in "${NM_NODE_TYPES[@]}"; do elif [ "${nodetype}" != "" ]; then
# echo -e "${idsST[Bold]}"; DIVIDER if [ "${NM_HOSTS[${nodetype}]}" != "" ]; then
# RUNCMD='' NT_HOSTS=${nodetype}_HOSTS[@]
# for i in {1..14}; do NTS=("${nodetype}");
# [ "${i}" != "1" ] && [ "${!i}" != "" ] && RUNCMD="${RUNCMD} " else
# [ "${!i}" != "" ] && RUNCMD="${RUNCMD}${!i}" echo -e "${idsCL[Red]}"${nodetype}" is an unknown NodeType.${idsCL[Default]}"
# done exit 1
# echo -e "${idsCL[Yellow]} ${NM_NODETYPES[$NTYPE]}-Nodes to run command { \`${RUNCMD}\` }${idsCL[Default]}" fi
# DIVIDER; echo -e "${idsST[Reset]}" fi
# for NTYPE in "${NTS[@]}"; do
# var=${NTYPE}_HOSTS[@] echo -e "${idsST[Bold]}"; DIVIDER
# for nip in "${!var}"; do echo -e "${idsCL[Yellow]} ${NM_NODETYPES[$NTYPE]}-Nodes to run command { \`${RUNCMD}\` }${idsCL[Default]}"
# if [[ ${RUN_NODE_IP} == *"${nip}"* ]]; then NCMD=''; LH='- localhost' DIVIDER; echo -e "${idsST[Reset]}"
# else NCMD="ssh -q -o ConnectTimeout=3 -o ConnectionAttempts=1 root@${nip}"; LH=''
# fi for nip in "${!NT_HOSTS}"; do
# echo -e " ${idsST[Bold]}${idsCL[LightCyan]}${NM_HOSTNAMES[${nip}]}[${nip}]${idsST[Reset]}${idsCL[LightCyan]} ${idsCL[LightYellow]}${LH}${idsCL[Default]}" if [[ ${RUN_NODE_IP} == *"${nip}"* ]]; then NCMD=''; LH='- localhost'
# DIVIDER false green else NCMD="ssh -q -o ConnectTimeout=3 -o ConnectionAttempts=1 root@${nip}"; LH=''
# #echo "Running command: ${NCMD} ${RUNCMD}" fi
# ${NCMD} "${RUNCMD}" echo -e " ${idsST[Bold]}${idsCL[LightCyan]}${NM_HOSTNAMES[${nip}]}[${nip}]${idsST[Reset]}${idsCL[LightCyan]} ${idsCL[LightYellow]}${LH}${idsCL[Default]}"
# DIVIDER false green DIVIDER false green
# echo echo "Running command: ${NCMD} ${RUNCMD}"
# done #${NCMD} "${RUNCMD}"
# echo DIVIDER false green
# done echo
done
echo
done
} }
DOWNLIST(){ DOWNLIST(){