#!/bin/bash . ./upgrade-funs.sh action="reboot" pid=$$ if [ "x$1" != "x" ]; then action=$1; fi running=$(./tomcat_ctl.sh status | grep "not running") if [ "x$running" == "x" ]; then printf "Call server command storeall.."; sleep 2 runcmd result if [ "x$result" == "xsuccess" ] then echo " done!" else echo " failed! exiting..." exit 1 fi echo "Stopping tomcat.."; sleep 2 ./tomcat_ctl.sh stop else echo "Tomcat is not running!" fi if [ $action == "reboot" ]; then echo "Starting tomcat..."; sleep 2 ./tomcat_ctl.sh start fi