From 9417a66d48990200ee5de00cdc2ad0e44b4d7b26 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Thu, 7 Feb 2019 10:39:16 -0600 Subject: [PATCH] update --- defaults.inc | 13 ++++++++----- nodemgmt-scripts.sh | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/defaults.inc b/defaults.inc index a9b1aaec..7bb568da 100755 --- a/defaults.inc +++ b/defaults.inc @@ -57,21 +57,24 @@ REPL_DESC['gitssh']='Gitea SSH Keys' DISP_HEADER(){ + declare -i cw; declare -i spc1; declare -i c if [ "$1" = true ]; then clear fi echo "" - echo -e "${idsCL[Yellow]} NodeMgmt - Galera/NGINX Node Management${idsCL[Default]} ${idsCL[DarkGray]}(ver-${VERS})${idsCL[Default]}" - DIVIDER + echo -e "${idsCL[LightYellow]} NodeMgmt - Galera/NGINX Node Management${idsCL[Default]} ${idsCL[DarkGray]}(ver-${VERS})${idsCL[Default]}" + DIVIDER . lightYellow if [ "$2" = true ]; then - echo -e "Node hostname: ${idsST[Bold]}${idsCL[LightCyan]}${NODE_HOSTNAME}${idsCL[Default]}${idsST[Reset]}" + echo -e "Node hostname : ${idsST[Bold]}${idsCL[LightCyan]}${NODE_HOSTNAME}${idsCL[Default]}${idsST[Reset]}" if [ -z ${LOCAL_SERVICES+x} ]; then SERVICES=$( IFS=$','; echo "${NODE_SERVICES[*]}" ) else SERVICES=$( IFS=$','; echo "${LOCAL_SERVICES[*]}" ) fi IFS=,; SERVICES2=(${SERVICES}); unset IFS for srvc in "${SERVICES2[@]}"; 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]}" diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index b677dae3..cdb8ed78 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -75,7 +75,7 @@ STATUS() { echo echo -e "${idsCL[Yellow]} Replication Status to Other Nodes${idsCL[Default]}" DIVIDER true - timeout=`date --date='40 seconds' +%s` + timeout=`date --date='20 seconds' +%s` nid=1 for nip in "${NODE_HOSTS[@]}" do