大家好
比如
[root@localhost]# tomcat [start|stop|reload|restart]
即可完成啟動
優點是
下面詳細解釋一下如何建立這種腳本(以下是
#
# !/bin/bash
# Description: start or stop the tomcat
# Usage: tomcat [start|stop|reload|restart]
# Author: Wang Yinghui
# Date: Thu Apr
#
export PATH=$PATH:$HOME/bin
export BASH_ENV=$HOME/
export USERNAME=
case
start)
#startup the tomcat
echo
cd /home/tomcat
cd /home/tomcat
echo
;;
stop)
# stop tomcat
echo
ps
echo
;;
reload|restart)
$
$
;;
*)
echo
exit
esac
exit
[root@localhost]# chmod
[root@localhost]# cd /usr/bin
[root@localhost]# ln
[root@localhost]# tomcat start (啟動)
[root@localhost]# tomcat stop (停止)
[root@localhost]# tomcat restart (重啟動)
[root@localhost]# ln
[root@localhost]# ln
有問題或建議
From:http://tw.wingwit.com/Article/program/Java/ky/201311/28034.html