I am a novice to Linux system. My requirement is to run a Linux status script which echos a message (message is either "App is running" or "App is not running").
If the message is "App is running" then run another shell script to stop the App. Then run the status shell script again after a few seconds. When I read "App is not running", then run Deploy script to deploy new application.
The status script is written in Bash:
if [ "$(ps -ef | grep -i cat ${TPSHUB_HOME}/current.pid
| grep -v grep|awk '{ print $2 }')" ];then
echo "TpsHub is RUNNING"
else
echo "TpsHub is NOT running"
fi
exit
uname -a
– Kevdog777 Dec 13 '13 at 16:55cat ${TPSHUB_HOME}/current.pid
| grep -v grep|awk '{ print $2 }')" ] then echo "TpsHub is RUNNING" else echo "TpsHub is NOT running" fi exit – user3100063 Dec 13 '13 at 17:39