DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

StartupItem Script For Tomcat On OS X 10.3

10.06.2005
| 4205 views |
  • submit to reddit
        
#!/bin/sh
        
##
# Start Tomcat
##

. /etc/rc.common

export JAVA_HOME=/Library/Java/Home
export CATALINA_HOME="/usr/local/tomcat"
export TOMCAT_HOME="/usr/local/tomcat"

StartService ()
{

	if [ "${TOMCAT:=-NO-}" = "-YES-" ]; then

	    ConsoleMessage "Starting Tomcat"
            sh ${TOMCAT_HOME}/bin/startup.sh
	fi

}

StopService()
{

	ConsoleMessage "Stopping Tomcat"
    sh ${TOMCAT_HOME}/bin/shutdown.sh
}

RestartService ()
{
    StopService
    StartService
}


RunService "$1"