Skip to content

Commit 0bff046

Browse files
authored
Update tomcat.md
1 parent f346a84 commit 0bff046

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

shell/tomcat.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
# Source function library.
1010
. /etc/rc.d/init.d/functions
1111

12+
export JAVA_HOME=
13+
export JRE_HOME=
14+
1215
# tomcat名字
1316
tcName=tomcat-$1
1417
basedir=/data/program/tomcat/$tcName
@@ -55,7 +58,7 @@ status(){
5558
echo -n ") 正在运行"
5659
echo
5760
else
58-
echo "-- Tomcat 停止运行"
61+
echo "###### Tomcat未运行 ######"
5962
fi
6063
#echo "---------------------------------------------"
6164
}
@@ -70,7 +73,7 @@ log(){
7073
kill(){
7174
checkrun
7275
if [ $RETVAL -eq 1 ]; then
73-
read -p "-- 确定要杀死 ${tcName} 的进程吗?[no])" answer
76+
read -p "###### 确定要杀死 ${tcName} 的进程吗?[no])" answer
7477
case $answer in
7578
Y|y|YES|yes|Yes)
7679
ps ax --width=1000 |grep ${tcName}|grep "org.apache.catalina.startup.Bootstrap start" | awk '{printf $1 " "}'|xargs kill -9
@@ -79,7 +82,7 @@ kill(){
7982
*);;
8083
esac
8184
else
82-
echo "-- exit with $tcName still running..."
85+
echo "###### 退出 [$tcName] ######"
8386
fi
8487
}
8588

@@ -100,7 +103,7 @@ checkrun(){
100103
checklog(){
101104
answer=$1
102105
if [ "$answer" != "yes" ]; then
103-
read -p "-- 查看 catalina.out 日志吗 $2 status?[yes])" answer
106+
read -p "###### 查看 <catalina.out> 日志吗 $2?[yes])" answer
104107
fi
105108
case $answer in
106109
Y|y|YES|yes|Yes|"")
@@ -114,7 +117,7 @@ checklog(){
114117
}
115118
checkexist(){
116119
if [ ! -d $basedir ]; then
117-
echo "-- tomcat $basedir does not exist."
120+
echo "###### tomcat $basedir 不存在 ######"
118121
exit 0
119122
fi
120123
}
@@ -155,8 +158,8 @@ kill)
155158
exit 0
156159
;;
157160
*)
158-
echo "使用方法: service $0 [start|stop|restart|status|log|kill]"
159-
echo "举个栗子-> service tomcat xintr start"
161+
echo "###### 使用方法: service $0 [start|stop|restart|status|log|kill]"
162+
echo "###### 举个栗子-> service tomcat xintr start"
160163
esac
161164

162165
exit 0

0 commit comments

Comments
 (0)