Created
March 15, 2015 16:34
-
-
Save jamesnguyen101/27438f371c662908bec2 to your computer and use it in GitHub Desktop.
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
#!/bin/sh | |
TOMCAT_HOME="/opt/yosport/yosport_app/tomcat8" | |
TOMCAT_USER=root | |
#all app name that start with yo prefix | |
app_name="yo*" | |
# stop tomcat if it is running | |
TOMCAT_PID=`ps -ef | grep "$TOMCAT_HOME/" | grep 'Bootstrap start$' | awk '{print $2}'` | |
if [ ! -z $TOMCAT_PID ] ; then | |
echo "Tomcat still be running with PID $TOMCAT_PID." | |
# stop tomcat | |
su - $TOMCAT_USER -c "$TOMCAT_HOME/bin/catalina.sh stop 5 -force " | |
fi | |
## clear file & dir temp | |
echo "Remove [templ/*] dir" | |
rm -rf $TOMCAT_HOME/temp/* | |
echo "Remove [work/*] dir " | |
rm -rf $TOMCAT_HOME/work/Catalina | |
echo "Remove [logs/*] files" | |
rm -rf $TOMCAT_HOME/logs/* | |
echo "Removing [$app_name] dir and war file " | |
rm -rf $TOMCAT_HOME/webapps/$app_name | |
rm -rf $TOMCAT_HOME/webapps/$app_name.war | |
rm -rf $TOMCAT_HOME/logs-* | |
echo "Remove [~/.jrebel] dir " | |
rm -rf ~/.jrebel/ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment