Created
November 8, 2012 07:09
-
-
Save goncha/4037341 to your computer and use it in GitHub Desktop.
BASH script to control tomcat instance on customized CATALINA_BASE with CATALINA_PID
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
usage () { | |
echo "Usage: $0 <startup|shutdown>" | |
exit 1 | |
} | |
if [ $# -lt 1 ] | |
then | |
usage | |
fi | |
INSTANCE_BASE=$(dirname $0) | |
INSTANCE_BASE=$(pwd -P $INSTANCE_BASE) | |
INSTANCE_BASE=${INSTANCE_BASE%%/bin} | |
export JAVA_HOME=/home/app/opt/jdk | |
export CATALINA_HOME=/home/app/opt/tomcat | |
export CATALINA_BASE=$INSTANCE_BASE | |
export CATALINA_PID=$CATALINA_BASE/logs/catalina.pid | |
if [ "$1" == "startup" ] | |
then | |
$CATALINA_HOME/bin/startup.sh start | |
elif [ "$1" == "shutdown" ] | |
then | |
$CATALINA_HOME/bin/shutdown.sh | |
else | |
usage | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment