[Shelll Script] check tomcat status

!/bin/bash

tomcat7=$(ps -ef | grep tomcat | wc -l)

echo ${#tomcat7}

if [ ${#tomcat7} -gt 0 ]; then
printf "tomcat is running\n"
else
printf "tomcat is not running\n"
fi

This entry was posted in Linux, Shell Script, Tomcat. Bookmark the permalink.