Update nodemgmt-scripts.sh
This commit is contained in:
@@ -771,31 +771,40 @@ BACKUP_UNIFINVR(){
|
||||
}
|
||||
|
||||
RUN_COMMAND(){
|
||||
echo "${1} ${2} ${3} ${4} ${5} ${6} ${7} ${8} ${9} ${10} ${11} ${12} ${13} ${14}"
|
||||
for NTYPE in "${NM_NODE_TYPES[@]}"; do
|
||||
echo -e "${idsST[Bold]}"; DIVIDER
|
||||
RUNCMD=''
|
||||
for i in {1..14}; do
|
||||
[ "${i}" != "1" ] && [ "${!i}" != "" ] && RUNCMD="${RUNCMD} "
|
||||
[ "${!i}" != "" ] && RUNCMD="${RUNCMD}${!i}"
|
||||
done
|
||||
echo -e "${idsCL[Yellow]} ${NM_NODETYPES[$NTYPE]}-Nodes to run command { \`${RUNCMD}\` }${idsCL[Default]}"
|
||||
DIVIDER; echo -e "${idsST[Reset]}"
|
||||
|
||||
var=${NTYPE}_HOSTS[@]
|
||||
for nip in "${!var}"; 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
|
||||
RUNCMD=''
|
||||
while [ $# -gt 0 ]; do
|
||||
case "${1}" in
|
||||
-nt|-nodetype) nodetype=${2^^};;
|
||||
*) RUNCMD="${1} ";;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
echo "${RUNCMD}"
|
||||
|
||||
# for NTYPE in "${NM_NODE_TYPES[@]}"; do
|
||||
# echo -e "${idsST[Bold]}"; DIVIDER
|
||||
# RUNCMD=''
|
||||
# for i in {1..14}; do
|
||||
# [ "${i}" != "1" ] && [ "${!i}" != "" ] && RUNCMD="${RUNCMD} "
|
||||
# [ "${!i}" != "" ] && RUNCMD="${RUNCMD}${!i}"
|
||||
# done
|
||||
# echo -e "${idsCL[Yellow]} ${NM_NODETYPES[$NTYPE]}-Nodes to run command { \`${RUNCMD}\` }${idsCL[Default]}"
|
||||
# DIVIDER; echo -e "${idsST[Reset]}"
|
||||
#
|
||||
# var=${NTYPE}_HOSTS[@]
|
||||
# for nip in "${!var}"; 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(){
|
||||
|
||||
Reference in New Issue
Block a user