Last active
December 11, 2019 02:22
-
-
Save isurfer21/2bd511cc80e258048777c84a11855a1f to your computer and use it in GitHub Desktop.
Shell based Apache Tomcat agent
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
APP_VER="19.9.20" | |
version() { | |
echo " Version $APP_VER \n" | |
} | |
help() { | |
echo "\n Apache Tomcat Agent version $APP_VER \n Copyright (c) 2019 Abhishek Kumar. All rights reserved." | |
echo "\n Options:" | |
echo " -v --version to see the current version of the app" | |
echo " -h --help to see the menu of command line options" | |
echo "\n Commands:" | |
echo " start to start the tomcat server" | |
echo " restart to restart the tomcat server" | |
echo " stop to stop the tomcat server" | |
echo "\n Please choose accordingly. \n" | |
} | |
if [[ "$1" == "" ]]; then | |
echo " Command missing! \n" | |
else | |
cd $ROOT_DIR | |
case "$1" in | |
'start') | |
echo " Start the tomcat server" | |
$CATALINA_HOME/bin/catalina.sh start | |
;; | |
'restart') | |
echo " Restart the tomcat server" | |
$CATALINA_HOME/bin/catalina.sh restart | |
;; | |
'stop') | |
echo " Stop the tomcat server" | |
$CATALINA_HOME/bin/catalina.sh stop | |
;; | |
'-v') | |
version | |
;; | |
'--version') | |
version | |
;; | |
'-h') | |
help | |
;; | |
'--help') | |
help | |
;; | |
esac | |
fi | |
exit 0 |
Author
isurfer21
commented
Sep 20, 2019
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment