jboss-cli.sh 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #!/bin/sh
  2. DIRNAME=`dirname "$0"`
  3. # OS specific support (must be 'true' or 'false').
  4. cygwin=false;
  5. darwin=false;
  6. linux=false;
  7. case "`uname`" in
  8. CYGWIN*)
  9. cygwin=true
  10. ;;
  11. Darwin*)
  12. darwin=true
  13. ;;
  14. Linux)
  15. linux=true
  16. ;;
  17. esac
  18. # For Cygwin, ensure paths are in UNIX format before anything is touched
  19. if $cygwin ; then
  20. [ -n "$JBOSS_HOME" ] &&
  21. JBOSS_HOME=`cygpath --unix "$JBOSS_HOME"`
  22. [ -n "$JAVA_HOME" ] &&
  23. JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
  24. [ -n "$JAVAC_JAR" ] &&
  25. JAVAC_JAR=`cygpath --unix "$JAVAC_JAR"`
  26. fi
  27. # Setup JBOSS_HOME
  28. RESOLVED_JBOSS_HOME=`cd "$DIRNAME/.."; pwd`
  29. if [ "x$JBOSS_HOME" = "x" ]; then
  30. # get the full path (without any relative bits)
  31. JBOSS_HOME=$RESOLVED_JBOSS_HOME
  32. else
  33. SANITIZED_JBOSS_HOME=`cd "$JBOSS_HOME"; pwd`
  34. if [ "$RESOLVED_JBOSS_HOME" != "$SANITIZED_JBOSS_HOME" ]; then
  35. echo "WARNING JBOSS_HOME may be pointing to a different installation - unpredictable results may occur."
  36. echo ""
  37. fi
  38. fi
  39. export JBOSS_HOME
  40. # Setup the JVM
  41. if [ "x$JAVA" = "x" ]; then
  42. if [ "x$JAVA_HOME" != "x" ]; then
  43. JAVA="$JAVA_HOME/bin/java"
  44. else
  45. JAVA="java"
  46. fi
  47. fi
  48. # For Cygwin, switch paths to Windows format before running java
  49. if $cygwin; then
  50. JBOSS_HOME=`cygpath --path --windows "$JBOSS_HOME"`
  51. JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
  52. fi
  53. if $darwin ; then
  54. # Add the apple gui packages for the gui client
  55. JAVA_OPTS="$JAVA_OPTS -Djboss.modules.system.pkgs=com.apple.laf,com.apple.laf.resources"
  56. else
  57. # Add base package for L&F
  58. JAVA_OPTS="$JAVA_OPTS -Djboss.modules.system.pkgs=com.sun.java.swing"
  59. fi
  60. # Sample JPDA settings for remote socket debugging
  61. #JAVA_OPTS="$JAVA_OPTS -agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n"
  62. eval \"$JAVA\" $JAVA_OPTS \"-Dlogging.configuration=file:$JBOSS_HOME/bin/jboss-cli-logging.properties\" -jar \"$JBOSS_HOME/jboss-modules.jar\" -mp \"$JBOSS_HOME/modules\" org.jboss.as.cli '"$@"'