Update nodemgmt-scripts.sh

This commit is contained in:
2019-03-06 13:19:04 -06:00
parent 15d2170eda
commit 7eb0688aac

View File

@@ -43,17 +43,19 @@ STATUS(){
# else
# NHCMD=''
# fi
for rcheck in "${NODE_REPL_CHECK[@]}"; do
${NHCMD} rm -f ${FOLDER}/test.repl
daterun=`date +%Y-%m-%d-%H-%M-%S`
if [ "${NHCMD}" = "" ]; then
echo -e "MySQL-Node${nid} (${nip})\n${daterun}" > ${FOLDER}/test.repl
yes | cp -rfH ${FOLDER}/test.repl ${REPL_CHECKS[${rcheck}]}/test.repl
else
${NHCMD} "echo -e \"Status-Check (${NODE_HOSTNAME})\n${daterun}\" > ${FOLDER}/test.repl"
yes | ${NHCMD} "cp -rfH ${FOLDER}/test.repl ${REPL_CHECKS[${rcheck}]}/test.repl"
fi
done
if [ ! -z ${NODE_REPL_CHECK+x} ]; then
for rcheck in "${NODE_REPL_CHECK[@]}"; do
${NHCMD} rm -f ${FOLDER}/test.repl
daterun=`date +%Y-%m-%d-%H-%M-%S`
if [ "${NHCMD}" = "" ]; then
echo -e "MySQL-Node${nid} (${nip})\n${daterun}" > ${FOLDER}/test.repl
yes | cp -rfH ${FOLDER}/test.repl ${REPL_CHECKS[${rcheck}]}/test.repl
else
${NHCMD} "echo -e \"Status-Check (${NODE_HOSTNAME})\n${daterun}\" > ${FOLDER}/test.repl"
yes | ${NHCMD} "cp -rfH ${FOLDER}/test.repl ${REPL_CHECKS[${rcheck}]}/test.repl"
fi
done
fi
for rcheck in "${WEB_REPL_CHECK[@]}"; do
${WHCMD} rm -f ${FOLDER}/test.repl
daterun=`date +%Y-%m-%d-%H-%M-%S`
@@ -319,10 +321,10 @@ STATUS(){
echo -e "${idsCL[Yellow]} Replication Status Between the Primary and Secondary Nodes${idsCL[Default]}"
DIVIDER; echo -e "${idsST[Reset]}"
fi
if [ -z ${NODE_REPL_CHECK+x} ]; then
if [ ! -z ${NODE_REPL_CHECK+x} ]; then
nid=1
for nip in "${NODE_HOSTS[@]}"; do
if [[ $(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) != *"${nip}"* ]] && [ "${nip}" = "${NODE_HOSTS[0]}" ]; then
if [[ $(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) != *"${nip}"* ]] && [ "${nip}" != "${NODE_HOSTS[0]}" ]; then
if [ "${ST_ACTION}" != "check" ]; then
echo -e " ${idsCL[LightCyan]}MySQL-Node1 (${NODE_HOSTS[0]}) <--> ${idsST[Bold]}MySQL-Node${nid} (${nip})${idsST[Reset]}${idsCL[Default]}"
DIVIDER false green
@@ -388,7 +390,7 @@ STATUS(){
fi
nid=1
for nip in "${WEB_HOSTS[@]}"; do
if [[ $(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) != *"${nip}"* ]] && [ "${nip}" = "${WEB_HOSTS[0]}" ]; then
if [[ $(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) != *"${nip}"* ]] && [ "${nip}" != "${WEB_HOSTS[0]}" ]; then
if [ "${ST_ACTION}" != "check" ]; then
echo -e " ${idsCL[LightCyan]}Webserver-Node1 (${WEB_HOSTS[0]}) <--> ${idsST[Bold]}Webserver-Node${nid} (${nip})${idsST[Reset]}${idsCL[Default]}"
DIVIDER false green