Return to Snippet

Revision: 42002
at February 26, 2011 01:41 by dogrizz


Initial Code
#!/bin/bash

while getopts ":crp" optname
  do
    case "$optname" in
      "c")
        echo "Cleaning ears"
        rm -fv jboss-5.1.0.GA/server/default/deploy/*.ear
        echo "Cleaning work"
        rm -rf jboss-5.1.0.GA/server/default/work/
        echo "Cleaning tmp"
        rm -rf jboss-5.1.0.GA/server/default/tmp/
        echo "Cleaning log"
        rm -rf jboss-5.1.0.GA/server/default/log/
        ;;
      "r")
        echo "Running with rebel"
        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"
        jboss-5.1.0.GA/bin/run.sh -b 0.0.0.0 
        ;;
      "p")
        echo "Running without rebel"
	export JAVA_OPTS=""
        jboss-5.1.0.GA/bin/run.sh -b 0.0.0.0
        ;;
      "?")
        echo "Unknown option $OPTARG"
        ;;
      ":")
        echo "No argument value for option $OPTARG"
        ;;
      *)
      # Should not occur
        echo "Unknown error while processing options"
        ;;
    esac
  done

Initial URL

                                

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

Initial Title
jboss startup script

Initial Tags
Bash

Initial Language
Bash