Skip to content

Instantly share code, notes, and snippets.

@user454322
Created October 30, 2013 09:30
Show Gist options
  • Save user454322/7229654 to your computer and use it in GitHub Desktop.
Save user454322/7229654 to your computer and use it in GitHub Desktop.
Tomcat script
#!/bin/bash
# description: Tomcat Start Stop Restart
# chkconfig: 345 82 25
export JAVA_HOME="/usr/lib/jvm/java"
export PATH="${JAVA_HOME}/bin:${PATH}"
CATALINA_HOME="/opt/tomcat/tomcat-7.0.47"
case $1 in
start)
/bin/su tomcat -c "${CATALINA_HOME}/bin/startup.sh"
;;
stop)
/bin/su tomcat -c "${CATALINA_HOME}/bin/shutdown.sh"
;;
restart)
/bin/su tomcat -c "${CATALINA_HOME}/bin/shutdown.sh" && /bin/su tomcat -c "${CATALINA_HOME}/bin/startup.sh"
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment