This commit is contained in:
2019-02-07 09:38:46 -06:00
parent 8413f001b8
commit bdddd5aed5
2 changed files with 8 additions and 5 deletions

View File

@@ -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

View File

@@ -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