#!/bin/sh ####################################################### ## ## ## script for restart wcmapp.shutdown and then startup ## ## ####################################################### ####################################################### ## ## vars: ## SH_SHUTDOWN the shutdown shell script. e.g.:/home/TRS/TRSWCMV65/Tomcat/bin/shutdown.sh -force ## SH_STARTUP the startup shell script. e.g.:/home/TRS/TRSWCMV65/Tomcat/bin/startup.sh ## WCMAPP_PID the pid file of the app. e.g.:/home/TRS/TRSWCMV65/Tomcat/wcmv65_tomcat.pid ## PROGRAM the unique program line for pgrep checking process. e.g.:java ## WAIT_SECS the shutdown duration,in seconds. ## ####################################################### ##SH_SHUTDWON="/home/wcmteam/WCMV7/Tomcat/bin/shutdown.sh -force" SH_SHUTDWON= ##SH_STARTUP=/home/wcmteam/WCMV7/Tomcat/bin/startup.sh SH_STARTUP= ##WCMAPP_PID=/home/wcmteam/WCMV7/Tomcat/wcmv7_tomcat.pid #caution:rm -f will be executed on this file without test what it is. WCMAPP_PID= PROGRAM=WCMV7 WAIT_SECS=60 echo 'shuting down wcmapp' $SH_SHUTDOWN #check via pgrep, use kill if not shutdown.TODO: use WCMAPP_PID may be better. sleep $WAIT_SECS pgrep -f "$PROGRAM"|xargs -l kill -9 #remove pid file if exists [ -f "$WCMAPP_PID" ] && rm -f "$WCMAPP_PID" echo 'start wcmapp' $SH_STARTUP #TODO send notify email via sendmail?