Posted By

dogrizz on 02/26/11


Tagged

Bash JBoss jrebel


Versions (?)

jboss startup script


 / Published in: Bash
 

Tired of running seperate scripts for jBoss with/out jRebel and manual cleaning temp.

  1. #!/bin/bash
  2.  
  3. while getopts ":crp" optname
  4. do
  5. case "$optname" in
  6. "c")
  7. echo "Cleaning ears"
  8. rm -fv jboss-5.1.0.GA/server/default/deploy/*.ear
  9. echo "Cleaning work"
  10. rm -rf jboss-5.1.0.GA/server/default/work/
  11. echo "Cleaning tmp"
  12. rm -rf jboss-5.1.0.GA/server/default/tmp/
  13. echo "Cleaning log"
  14. rm -rf jboss-5.1.0.GA/server/default/log/
  15. ;;
  16. "r")
  17. echo "Running with rebel"
  18. export JAVA_OPTS="-noverify -javaagent:/home/dogrizz/tools/jrebel/jrebel.jar -Xms256m -Xmx1024m -XX:MaxPermSize=512m -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n -XX:+UseParallelGC $JAVA_OPTS"
  19. jboss-5.1.0.GA/bin/run.sh -b 0.0.0.0
  20. ;;
  21. "p")
  22. echo "Running without rebel"
  23. export JAVA_OPTS=""
  24. jboss-5.1.0.GA/bin/run.sh -b 0.0.0.0
  25. ;;
  26. "?")
  27. echo "Unknown option $OPTARG"
  28. ;;
  29. ":")
  30. echo "No argument value for option $OPTARG"
  31. ;;
  32. *)
  33. # Should not occur
  34. echo "Unknown error while processing options"
  35. ;;
  36. esac
  37. done

Report this snippet  

You need to login to post a comment.