This commit is contained in:
2019-01-28 13:15:57 -06:00
parent 20a93cca7c
commit a348f08d06
2 changed files with 7 additions and 7 deletions

View File

@@ -43,7 +43,7 @@ case "$1" in
fi
echo -en "${ADISP}ing Node ${nid} ($nip)...${idsCL[Default]}"
$NCMD systemctl $3 $2
if [[ $(${NCMD} pgrep ${2} | wc -l) -gt "1" ]]; then
if [[ $(${NCMD} pgrep ${2} | wc -l) -gt "0" ]]; then
echo -e "${idsCL[Green]}OK${idsCL[Default]}"
elif [ "$3" = "Stop" ]; then echo -e "${idsCL[Red]}STOPPED${idsCL[Default]}"
else echo -e "${idsCL[Red]}ERROR${idsCL[Default]}"

12
run.sh
View File

@@ -8,27 +8,27 @@ source /opt/idssys/defaults/colors.inc
VERS=`mysql -h 10.5.10.56 -P 3308 -u sqluser -pdcs2057 -s -N -e "SELECT value FROM idssys.nodemgmt WHERE var = 'VERS'"`
if [ "$1" != "service" ] && [ "$1" != "" ]; then
if [ $(pgrep mysql | wc -l) -gt "1" ]; then
if [ $(pgrep mysql | wc -l) -gt "0" ]; then
SER_MYSQL="${idsCL[Green]}Running${idsCL[Default]}"
else SER_MYSQL="${idsCL[Red]}Not Running${idsCL[Default]}"
fi
if [ $(pgrep haproxy | wc -l) -gt "1" ]; then
if [ $(pgrep haproxy | wc -l) -gt "0" ]; then
SER_HAP="${idsCL[Green]}Running${idsCL[Default]}"
else SER_HAP="${idsCL[Red]}Not Running${idsCL[Default]}"
fi
if [ $(pgrep nginx | wc -l) -gt "1" ]; then
if [ $(pgrep nginx | wc -l) -gt "0" ]; then
SER_NGINX="${idsCL[Green]}Running${idsCL[Default]}"
else SER_NGINX="${idsCL[Red]}Not Running${idsCL[Default]}"
fi
if [ $(pgrep keepalived | wc -l) -gt "1" ]; then
if [ $(pgrep keepalived | wc -l) -gt "0" ]; then
SER_KA="${idsCL[Green]}Running${idsCL[Default]}"
else SER_KA="${idsCL[Red]}Not Running${idsCL[Default]}"
fi
if [ $(pgrep gogs | wc -l) -gt "1" ]; then
if [ $(pgrep gogs | wc -l) -gt "0" ]; then
SER_GOGS="${idsCL[Green]}Running${idsCL[Default]}"
else SER_GOGS="${idsCL[Red]}Not Running${idsCL[Default]}"
fi
if [ $(pgrep maxscale | wc -l) -gt "1" ]; then
if [ $(pgrep maxscale | wc -l) -gt "0" ]; then
SER_MS="${idsCL[Green]}Running${idsCL[Default]}"
else SER_MS="${idsCL[Red]}Not Running${idsCL[Default]}"
fi