Make catalina.sh more robust to different return values on different platforms
Patch provided by Thomas GL
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@921444
13f79535-47bb-0310-9956-
ffa450edef68
SLEEP=5
if [ ! -z "$1" ]; then
echo $1 | grep "[^0-9]" > /dev/null 2>&1
- if [ $? -eq 1 ]; then
+ if [ $? -gt 0 ]; then
SLEEP=$1
shift
fi
if [ ! -z "$CATALINA_PID" ]; then
if [ -f "$CATALINA_PID" ]; then
kill -0 `cat $CATALINA_PID` >/dev/null 2>&1
- if [ $? -eq 1 ]; then
+ if [ $? -gt 0 ]; then
echo "PID file ($CATALINA_PID) found but no matching process was found. Stop aborted."
exit 1
fi
if [ -f "$CATALINA_PID" ]; then
while [ $SLEEP -ge 0 ]; do
kill -0 `cat $CATALINA_PID` >/dev/null 2>&1
- if [ $? -eq 1 ]; then
+ if [ $? -gt 0 ]; then
rm $CATALINA_PID
break
fi