activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1087752 - /activemq/activemq-apollo/trunk/apollo-distro/src/main/release/bin/apollo
Date Fri, 01 Apr 2011 15:25:14 GMT
Author: chirino
Date: Fri Apr  1 15:25:13 2011
New Revision: 1087752

URL: http://svn.apache.org/viewvc?rev=1087752&view=rev
Log:
Detect if the current shell supports 'exec -a'

Modified:
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/bin/apollo

Modified: activemq/activemq-apollo/trunk/apollo-distro/src/main/release/bin/apollo
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-distro/src/main/release/bin/apollo?rev=1087752&r1=1087751&r2=1087752&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-distro/src/main/release/bin/apollo (original)
+++ activemq/activemq-apollo/trunk/apollo-distro/src/main/release/bin/apollo Fri Apr  1 15:25:13
2011
@@ -16,6 +16,19 @@
 # limitations under the License.
 # ------------------------------------------------------------------------
 
+# Not all shells support the 'exec -a newname' syntax..
+`exec -a test echo test 2> /dev/null`
+if [ "$?" -eq "1" ] ; then
+  EXEC="exec -a apollo"
+else
+  # Lets switch to bash if you have it installed...
+  if [ -f "/bin/bash" ] ; then
+    exec "/bin/bash" $0 $@ 
+  else
+    EXEC="exec"
+  fi
+fi
+
 # OS specific support.
 cygwin=false;
 darwin=false;
@@ -148,4 +161,4 @@ fi
 # Attempt to bump up the ulimit 
 ulimit -n 100000 > /dev/null 2> /dev/null
 
-exec -a apollo "$JAVACMD" ${JVM_FLAGS} ${SYSTEM_PROPS} -classpath "${CLASSPATH}" org.apache.activemq.apollo.cli.Apollo
$@
+${EXEC} "$JAVACMD" ${JVM_FLAGS} ${SYSTEM_PROPS} -classpath "${CLASSPATH}" org.apache.activemq.apollo.cli.Apollo
$@



Mime
View raw message