Shell script to detect and start tomcat

Shell Script

check if apache tomcat is running or not if stopped, script will detect and start

#!/bin/bash

#check if apache tomcat is running
if pgrep tomcat >/dev/null 2>&1
then
echo “Tomcat is running”
else

/usr/local/tomcat/bin/startup.sh
echo “Tomcat is not running”
fi

This entry was posted in Shell script, Unix/Linux. Bookmark the permalink.

Leave a Reply