Make Unix shell scripts for individual
authorrjung <rjung@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 20 Jun 2011 09:26:36 +0000 (09:26 +0000)
committerrjung <rjung@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 20 Jun 2011 09:26:36 +0000 (09:26 +0000)
commands consistent.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1137558 13f79535-47bb-0310-9956-ffa450edef68

bin/configtest.sh
bin/digest.sh
bin/shutdown.sh
bin/startup.sh
bin/version.sh

index 597d915..97adde4 100755 (executable)
 # limitations under the License.
 
 # -----------------------------------------------------------------------------
-# configtest for the CATALINA Server
+# Configuration Test Script for the CATALINA Server
 #
-# $Id: configtest.sh  $
+# $Id$
 # -----------------------------------------------------------------------------
 
 # Better OS/400 detection: see Bugzilla 31132
 os400=false
-darwin=false
 case "`uname`" in
-CYGWIN*) cygwin=true;;
 OS400*) os400=true;;
-Darwin*) darwin=true;;
 esac
 
 # resolve links - $0 may be a softlink
@@ -63,4 +60,3 @@ else
 fi 
 
 exec "$PRGDIR"/"$EXECUTABLE" configtest "$@"
-
index 2bffe2a..7397265 100755 (executable)
 # $Id$
 # -----------------------------------------------------------------------------
 
+# Better OS/400 detection: see Bugzilla 31132
+os400=false
+case "`uname`" in
+OS400*) os400=true;;
+esac
+
 # resolve links - $0 may be a softlink
 PRG="$0"
 
@@ -38,11 +44,19 @@ PRGDIR=`dirname "$PRG"`
 EXECUTABLE=tool-wrapper.sh
 
 # Check that target executable exists
-if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
-  echo "Cannot find $PRGDIR/$EXECUTABLE"
-  echo "The file is absent or does not have execute permission"
-  echo "This file is needed to run this program"
-  exit 1
-fi
+if $os400; then
+  # -x will Only work on the os400 if the files are: 
+  # 1. owned by the user
+  # 2. owned by the PRIMARY group of the user
+  # this will not work if the user belongs in secondary groups
+  eval
+else
+  if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
+    echo "Cannot find $PRGDIR/$EXECUTABLE"
+    echo "The file is absent or does not have execute permission"
+    echo "This file is needed to run this program"
+    exit 1
+  fi
+fi 
 
 exec "$PRGDIR"/"$EXECUTABLE" -server org.apache.catalina.realm.RealmBase "$@"
index 0aa93ef..6117c57 100755 (executable)
 # $Id$
 # -----------------------------------------------------------------------------
 
+# Better OS/400 detection: see Bugzilla 31132
+os400=false
+case "`uname`" in
+OS400*) os400=true;;
+esac
+
 # resolve links - $0 may be a softlink
 PRG="$0"
 
@@ -38,11 +44,19 @@ PRGDIR=`dirname "$PRG"`
 EXECUTABLE=catalina.sh
 
 # Check that target executable exists
-if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
-  echo "Cannot find $PRGDIR/$EXECUTABLE"
-  echo "The file is absent or does not have execute permission"
-  echo "This file is needed to run this program"
-  exit 1
-fi
+if $os400; then
+  # -x will Only work on the os400 if the files are: 
+  # 1. owned by the user
+  # 2. owned by the PRIMARY group of the user
+  # this will not work if the user belongs in secondary groups
+  eval
+else
+  if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
+    echo "Cannot find $PRGDIR/$EXECUTABLE"
+    echo "The file is absent or does not have execute permission"
+    echo "This file is needed to run this program"
+    exit 1
+  fi
+fi 
 
 exec "$PRGDIR"/"$EXECUTABLE" stop "$@"
index 1e2e76f..0cdcbf6 100755 (executable)
 
 # Better OS/400 detection: see Bugzilla 31132
 os400=false
-darwin=false
 case "`uname`" in
-CYGWIN*) cygwin=true;;
 OS400*) os400=true;;
-Darwin*) darwin=true;;
 esac
 
 # resolve links - $0 may be a softlink
index 07ee7f3..c11b4d7 100755 (executable)
 # $Id$
 # -----------------------------------------------------------------------------
 
+# Better OS/400 detection: see Bugzilla 31132
+os400=false
+case "`uname`" in
+OS400*) os400=true;;
+esac
+
 # resolve links - $0 may be a softlink
 PRG="$0"
 
@@ -33,16 +39,24 @@ while [ -h "$PRG" ] ; do
     PRG=`dirname "$PRG"`/"$link"
   fi
 done
-
 PRGDIR=`dirname "$PRG"`
 EXECUTABLE=catalina.sh
 
 # Check that target executable exists
-if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
-  echo "Cannot find $PRGDIR/$EXECUTABLE"
-  echo "The file is absent or does not have execute permission"
-  echo "This file is needed to run this program"
-  exit 1
-fi
+if $os400; then
+  # -x will Only work on the os400 if the files are: 
+  # 1. owned by the user
+  # 2. owned by the PRIMARY group of the user
+  # this will not work if the user belongs in secondary groups
+  eval
+else
+  if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
+    echo "Cannot find $PRGDIR/$EXECUTABLE"
+    echo "The file is absent or does not have execute permission"
+    echo "This file is needed to run this program"
+    exit 1
+  fi
+fi 
 
 exec "$PRGDIR"/"$EXECUTABLE" version "$@"