From 06bbe434d6f8e8eb3e3728b224908450736def70 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Mon, 4 Feb 2019 00:00:14 -0600 Subject: [PATCH] Update defaults.inc --- defaults.inc | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/defaults.inc b/defaults.inc index 843cf698..97c69f57 100755 --- a/defaults.inc +++ b/defaults.inc @@ -29,20 +29,21 @@ DISP_HEADER(){ echo "" echo -e "${idsCL[Yellow]} NodeMgmt - Galera/NGINX Node Management${idsCL[Default]} ${idsCL[DarkGray]}(ver-${VERS})${idsCL[Default]}" echo -e "${idsCL[Yellow]}-------------------------------------------------------------${idsCL[Default]}" - 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" - if [ $(pgrep ${srvc} | wc -l) -gt "0" ]; then - echo -e "${idsCL[Green]}Running${idsCL[Default]}" - else echo -e "${idsCL[Red]}Not Running${idsCL[Default]}" + if [ "$1" != false ]; then + 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 - done - echo -e "${idsCL[Yellow]}-------------------------------------------------------------${idsCL[Default]}" + 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" + if [ $(pgrep ${srvc} | wc -l) -gt "0" ]; then + echo -e "${idsCL[Green]}Running${idsCL[Default]}" + else echo -e "${idsCL[Red]}Not Running${idsCL[Default]}" + fi + done + echo -e "${idsCL[Yellow]}-------------------------------------------------------------${idsCL[Default]}" + fi echo "" } \ No newline at end of file