I have recently install tomcat8 on Ubuntu. It is located at /opt/tomcat/apache-tomcat-8.0.36/bin and need to run ./shutdown.sh and ./startup.sh manually. Can anybody suggest me a shell scrip that can do startup, shutdown and even restart servers ? Thanks in advance.
Asked
Active
Viewed 110 times
-1
-
try this http://stackoverflow.com/questions/192292/bash-how-best-to-include-other-scripts – user3644708 Jul 16 '16 at 19:06
1 Answers
2
this can help you
#!/bin/bash
start() {
/opt/tomcat/apache-tomcat-8.0.36/bin/startup.sh
}
stop() {
/opt/tomcat/apache-tomcat-8.0.36/bin/shutdown.sh
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo "Usage: $0 {start|stop|restart}"
esac
exit 0

Mustafa DOGRU
- 3,994
- 1
- 16
- 24