From 2948c38b1125855364bf9357d295743b8d276e9d Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sun, 3 Feb 2019 20:01:41 -0600 Subject: [PATCH] update --- defaults.inc | 25 ++++++++++++++++++++++++- nodemgmt-scripts.sh | 5 ++++- run.sh | 22 +--------------------- 3 files changed, 29 insertions(+), 23 deletions(-) diff --git a/defaults.inc b/defaults.inc index 256e0e97..843cf698 100755 --- a/defaults.inc +++ b/defaults.inc @@ -22,4 +22,27 @@ NM_SERVICES['keepalived']='Keepalived' NM_SERVICES['maxscale']='MaxScale' NM_SERVICES['cmon']='CC-Controller' NM_SERVICES['cmon-events']='CC-Events Manager' -NM_SERVICES['cmon-cloud']='CC-Cloud Daemon' \ No newline at end of file +NM_SERVICES['cmon-cloud']='CC-Cloud Daemon' + +DISP_HEADER(){ + clear + 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]}" + fi + done + echo -e "${idsCL[Yellow]}-------------------------------------------------------------${idsCL[Default]}" + echo "" +} \ No newline at end of file diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index 50f0c741..5b7af50d 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -405,6 +405,7 @@ SERVICE(){ } GUI(){ + DISP_HEADER while : do echo " [1] Node Status" @@ -426,7 +427,9 @@ GUI(){ 1) echo "" STATUS - read -n 1 -s -p "Press any key to continue";; + read -n 1 -s -p "Press any key to continue" + DISP_HEADER + ;; 2) GLANCES_INSTALL INSTALL_MENU;; 3) X11VNC_INSTALL diff --git a/run.sh b/run.sh index 1ecd24cb..df2978bf 100755 --- a/run.sh +++ b/run.sh @@ -12,28 +12,8 @@ source /opt/idssys/nodemgmt/defaults.inc if [ "$1" != "service" ] && [ "$1" != "status-check" ] && [ "$1" != "nightlyrenew" ]; then if [ -z $1 ] || "${1}" = "gui" ]; then - clear + DISP_HEADER fi - - 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]}" - fi - done - echo -e "${idsCL[Yellow]}-------------------------------------------------------------${idsCL[Default]}" - echo "" if [ "${1}" != "gui" ]; then echo -en "${idsCL[LightCyan]}Checking for updates...${idsCL[Default]}" echo ""