My Confluence restart script - created since Tomcat is not to good to close nicely and clean up resources.

Secondly, keeping an eye out for java stacktraces and that the server is actually airborne is to be prefered.

#!/bin/bash

if [ `whoami | grep root | wc -l` -eq 0 ]
then
	echo "You must be root"
	exit 1
fi

cd /tmp

echo "**Shutting down*****"
/opt/confluence/bin/shutdown.sh
echo "**Sleeping 20 ...**"
sleep 20
killall java

if [ `ps -ef | grep java | grep confluence | wc -l` -gt 0 ]
then
	echo "There are still java processes running...."
	exit 1
fi
echo "**Starting**"
/opt/confluence/bin/startup.sh
tail -f /opt/confluence/logs/catalina.out