tomcat 启动脚本

#!/bin/sh
#chkconfig: 345 85 15
#JAVA_HOME=/usr/lib/java
JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.5.x86_64
CATALINA_HOME=/root/apache-tomcat-7.0.29
export JAVA_HOME
export CATALINA_HOME
start=$CATALINA_HOME/bin/startup.sh
stop=$CATALINA_HOME/bin/shutdown.sh
start () {
   echo -n "starting tomcat:"
   $start
   echo "tomcat start ok "
}
stop () {
   echo "stoping tomcat "
   $stop
   echo "tomcat stop ok "
}
case  "$1" in
      start)
         start
         ;;
      stop)
        stop
         ;;
      restart)
       stop
       sleep 10
       start
        ;;
       *)
       echo  "用法不对"
esac
exit 0
 

你可能感兴趣的:(tomcat,centos,shell)