diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index d8ac3fca..b677dae3 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -35,12 +35,14 @@ STATUS() { DIVIDER if [ ! -z ${LOCAL_SERVICES+x} ]; then lip=$(/sbin/ip -o -4 addr list ens192 | awk '{print $4}' | cut -d/ -f1) - echo -e "Node hostname: ${idsST[Bold]}${idsCL[LightCyan]}${NODE_HOSTNAME} (${lip})${idsST[Reset]}${idsCL[LightCyan]} - localhost${idsCL[Default]}" + echo -e " ${idsST[Bold]}${idsCL[LightCyan]}${NODE_HOSTNAME} (${lip})${idsST[Reset]}${idsCL[LightCyan]} - localhost${idsCL[Default]}" DIVIDER false green for srvc in "${LOCAL_SERVICES[@]}" do - if [[ "mysql,nginx,gitea,haproxy,keepalived,maxscale" = *"${srvc}"* ]]; then spc=" "; else spc=""; fi - echo -en "${NM_SERVICES[${srvc}]} $spc" + c=0; cw=22; spc='' + spc1=${cw}-${#NM_SERVICES[${srvc}]} + until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done + echo -en " ${NM_SERVICES[${srvc}]}$spc: " if [ $(pgrep ${srvc} | wc -l) -gt "0" ]; then echo -e "${idsCL[Green]}Running${idsCL[Default]}" else echo -e "${idsCL[Red]}Not Running${idsCL[Default]}" @@ -58,10 +60,10 @@ STATUS() { DIVIDER false green for srvc in "${NODE_SERVICES[@]}" do - c=0; cw=26; spc='' + c=0; cw=22; spc='' spc1=${cw}-${#NM_SERVICES[${srvc}]} until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done - echo -en "${NM_SERVICES[${srvc}]}$spc: " + echo -en " ${NM_SERVICES[${srvc}]}$spc: " if [ $(${NCMD} pgrep ${srvc} | wc -l) -gt "0" ]; then echo -e "${idsCL[Green]}Running${idsCL[Default]}" else echo -e "${idsCL[Red]}Not Running${idsCL[Default]}" @@ -82,10 +84,10 @@ STATUS() { DIVIDER false green for rcheck in "${REPL_CHECK[@]}" do - c=0; cw=26; spc='' + c=0; cw=22; spc='' spc1=${cw}-${#REPL_DESC[${rcheck}]} until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done - echo -en "${REPL_DESC[${rcheck}]}${spc}: " + echo -en " ${REPL_DESC[${rcheck}]}${spc}: " checked=false until [ "${checked}" = "" ]; do checked=`ssh root@${nip} "cat ${REPL_CHECKS[${rcheck}]}/test.repl" | diff - ${REPL_CHECKS[${rcheck}]}/test.repl`