-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtomcat.sh
More file actions
executable file
·49 lines (40 loc) · 875 Bytes
/
tomcat.sh
File metadata and controls
executable file
·49 lines (40 loc) · 875 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
38
39
40
41
42
43
44
45
46
47
48
49
#! /bin/bash
# tomcat Start/Stop the tomcat server.
# chkconfig: 2345 90 60
# description: Tomcat script by Carlo Cancellieri
start() {
echo -n $"Starting $prog: "
echo
su - tomcat -s /bin/sh -c "CATALINA_BASE=$CATALINA_BASE $CATALINA_HOME/bin/startup.sh"
return $?
}
restart() {
stop
sleep 5
start
}
stop() {
echo -n $"Stopping $prog: "
echo
su - tomcat -s /bin/sh -c "CATALINA_BASE=$CATALINA_BASE $CATALINA_HOME/bin/shutdown.sh -force"
return $?
}
# TODO change me!
SERVICE="tomcat"
CATALINA_HOME="/usr/local/share/tomcat/"
CATALINA_BASE="/var/lib/$SERVICE"
prog="Apache Tomcat - $SERVICE"
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
*)
echo $"Usage: $0 {start|stop|restart}"
exit 1
esac