#!/bin/sh

RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m'

if [ $(pgrep --full /opt/submit/manageIdentities.py) ] ; then
   echo -e "${GREEN}identity manager${NC}"
else
   echo -e "${RED}identity manager${NC}"
fi
if [ $(pgrep --full /opt/submit/monitorTunnel.py) ] ; then
   echo -e "${GREEN}tunnel monitor${NC}"
else
   echo -e "${RED}tunnel monitor${NC}"
fi
if [ $(pgrep --full /opt/submit/monitorProbe) ] ; then
   echo -e "${GREEN}probe monitor${NC}"
else
   echo -e "${RED}probe monitor${NC}"
fi
if [ $(pgrep --uid root --full /usr/sbin/submit-server.py) ] ; then
   echo -e "${GREEN}submit server${NC}"
else
   echo -e "${RED}submit server${NC}"
fi
if [ $(pgrep --full /opt/submit/monitorJob.py) ] ; then
   echo -e "${GREEN}job monitor${NC}"
else
   echo -e "${RED}job monitor${NC}"
fi

if [ $(pgrep --full /var/condor/Grid/log/condor.pid) ] ; then
   echo -e "${GREEN}condor grid${NC}"
else
   echo -e "${RED}condor grid${NC}"
fi
