Tomcat启动脚本

[root@192 bin]# vim /etc/init.d/tomcat
#!/bin/bash
#描述:Tomcat快捷启动脚本
CATALINA_HOME=/usr/local/tomcat
case $1 in
    start)
        sh $CATALINA_HOME/bin/startup.sh
        ;;
    stop)
        sh $CATALINA_HOME/bin/shutdown.sh
        ;;
  restart)
sh $CATALINA_HOME/bin/shutdown.sh
sh $CATALINA_HOME/bin/startup.sh
        ;;
    *)
        echo 'please use : tomcat {start | stop | restart}'
 ;;
esac
exit 0

[root@192 bin]# chmod +x /etc/init.d/tomcat         #添加执行权限

 

posted @ 2023-03-20 22:12  北极之光的博客  阅读(43)  评论(0编辑  收藏  举报