# Sleep for a while.
echo "Waiting for $SLEEP_INTERVAL sec(s) for Tomcat shutdown porcess."
sleep $SLEEP_INTERVAL
# KILL'im!
NOT_DEAD=`ps ax|grep catalina|grep java | awk '{print $1}'`
if [ x"$NOT_DEAD" != x ]; then
echo "Tomcat is still working. Now send it SIGTERM."
kill -TERM $NOT_DEAD
else
echo "Tomcat has already gone. No action is taken."
fi