#!/bin/bash ISTOMCATRUNNING="$(ps -fu gcube | grep -v grep | grep -c java)" if (( $ISTOMCATRUNNING == 0 )) then sleep 60 ISTOMCATRUNNING="$(ps -fu gcube | grep -v grep | grep -c java)" fi if (( $ISTOMCATRUNNING == 0 )) then /etc/init.d/tomcat-instance-9000 restart fi exit 0