-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathzeJavaApp
More file actions
37 lines (30 loc) · 763 Bytes
/
zeJavaApp
File metadata and controls
37 lines (30 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
# /etc/init.d/zeJavaApp
# chmod +x /etc/init.d/zeJavaApp
PNAEM="zeJavaApp"
case "$1" in
start)
/usr/local/tomcat/$PNAEM/apache-tomcat-7.0.72/bin/startup.sh
;;
stop)
/usr/local/tomcat/$PNAEM/apache-tomcat-7.0.72/bin/shutdown.sh
pid=`ps -efl|grep $PNAEM|grep -v grep |grep -v "init"| awk '{print $4}'|tail -n 1`
while [ $pid ]
do
pid=`ps -efl|grep $PNAEM |grep -v grep|grep -v "init"|awk '{print $4}'|tail -n 1`
if [ $pid ];then
echo $pid
/bin/kill -9 $pid
fi
done
;;
restart)
$SCRIPTNAME stop
sleep 1
$SCRIPTNAME start
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart}"
exit 1
;;
esac