lunedì, febbraio 21, 2011

Stop jboss in the case it's running

If you need to stop jboss inside a shell script this block of code could be useful.

if ps -ef | grep "<jboss_home>/bin/run.jar" | grep -v grep
then
echo [deploy] Stopping Jboss...
<jboss_home>/bin/shutdown.sh -S --server=localhost:1199
sleep 12s
else
echo [deploy] Jboss was already stopped
sleep 2s
fi

Nessun commento: