Hi,
A script looks as follow:
Code:
#!/bin/sh
# Define the Jboss User:
JBOSSUSER=msgbp
# Define the Context:
CONTEXT=msgbp
# Define the MSGBP_HOME:
MSGBP_HOME="/opt/jboss/MSGBP"
# Read in option:
case "$1" in
start)
nohup $MSGBP_HOME/bin/run.sh -c msgbp -b 130.144.164.232 &
;;
cleanup)
if [ -n "'ps -fu $JBOSSUSER | grep -v grep | grep -v Agent | grep java | grep $CONTEXT'" ]
then
echo "JBoss is still running - please stop the service first"
else
echo "clean-up ..."
fi
;;
*)
echo "Usage: jboss { start | cleanup}"
;;
esac
# now we are at the end of all actions
exit 0
When I type
It should check if a Jboss instance is running.
My problem is: there is no Jboss instance running but it gives always out that "JBoss is still running - please stop the service first".
Besides, I've checked with ps -fu $JBOSSUSER | grep -v grep | grep -v Agent | grep java | grep $CONTEXT and the output string is empty.
Is there any error in my script?