From bdddd5aed5039539fea254c3a4ba18c580388c1d Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Thu, 7 Feb 2019 09:38:46 -0600 Subject: [PATCH] update --- defaults.inc | 2 +- nodemgmt-scripts.sh | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/defaults.inc b/defaults.inc index 8cedb1ab..fda10e1f 100755 --- a/defaults.inc +++ b/defaults.inc @@ -82,7 +82,7 @@ DIVIDER(){ if [ -z "$2" ]; then clr='Yellow' else clr=$2 fi - echo -e "${idsCL[${clr}]}-----------------------------------------------------------------------${idsCL[Default]}" + echo -e "${idsCL[${clr~}]}-----------------------------------------------------------------------${idsCL[Default]}" if [ "$1" = true ]; then echo "" fi diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index 35bc78c5..517e3a28 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -18,10 +18,12 @@ source /opt/idssys/nodemgmt/defaults.inc # ========================================================= # STATUS() { + echo -e "${idsCL[Yellow]} Node Service Status${idsCL[Default]}" + DIVIDER true if [ ! -z ${LOCAL_SERVICES+x} ]; then lip=$(/sbin/ip -o -4 addr list ens192 | awk '{print $4}' | cut -d/ -f1) - #DIVIDER true echo -e "Node hostname: ${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 @@ -32,16 +34,15 @@ STATUS() { fi done fi - + echo nid=1 for nip in "${NODE_HOSTS[@]}" do if [[ $(/sbin/ip -o -4 addr list ens192 | awk '{print $4}' | cut -d/ -f1) == *"${nip}"* ]]; then NCMD=''; LH='- localhost' else NCMD="ssh root@${nip}"; LH='' fi - - DIVIDER true echo -e "Node hostname: ${idsST[Bold]}${idsCL[LightCyan]}iDS-Node${nid} (${nip})${idsST[Reset]}${idsCL[LightCyan]} ${LH}${idsCL[Default]}" + DIVIDER false green for srvc in "${NODE_SERVICES[@]}" do if [[ "mysql,nginx,gitea,haproxy,keepalived,maxscale" = *"${srvc}"* ]]; then spc=" "; else spc=""; fi @@ -51,6 +52,7 @@ STATUS() { else echo -e "${idsCL[Red]}Not Running${idsCL[Default]}" fi done + echo nid=`expr $nid + 1` done @@ -66,6 +68,7 @@ STATUS() { DIVIDER false green fi + echo nid=`expr $nid + 1` done