2008-04-07 22:37:26 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2013-06-11 17:35:03 +00:00
|
|
|
if [ "$1" = "version" ]; then
|
|
|
|
. /usr/libexec/tomcat/preamble
|
|
|
|
exec ${JAVACMD} -classpath ${CATALINA_HOME}/lib/catalina.jar \
|
|
|
|
org.apache.catalina.util.ServerInfo
|
2012-12-23 22:24:16 +00:00
|
|
|
fi
|
|
|
|
|
2013-06-11 17:35:03 +00:00
|
|
|
SRV="tomcat"
|
|
|
|
if [ -n "$2" ]; then
|
|
|
|
SRV="tomcat@$2"
|
2008-04-07 22:37:26 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$1" = "start" ]; then
|
2013-06-11 17:35:03 +00:00
|
|
|
systemctl start ${SRV}.service
|
2008-04-07 22:37:26 +00:00
|
|
|
elif [ "$1" = "stop" ]; then
|
2013-06-11 17:35:03 +00:00
|
|
|
systemctl stop ${SRV}.service
|
2008-04-07 22:37:26 +00:00
|
|
|
elif [ "$1" = "version" ]; then
|
|
|
|
${JAVACMD} -classpath ${CATALINA_HOME}/lib/catalina.jar \
|
|
|
|
org.apache.catalina.util.ServerInfo
|
|
|
|
else
|
2013-06-11 17:35:03 +00:00
|
|
|
echo "Usage: $0 {start|stop|version} [server-id]"
|
2008-04-07 22:37:26 +00:00
|
|
|
exit 1
|
|
|
|
fi
|