Index: run.sh =================================================================== --- run.sh (revision 90747) +++ run.sh (revision 90746) @@ -11,6 +11,36 @@ PROGNAME=`basename $0` GREP="grep" +# Set conf if specified, else set to default +JBOSSCONF="default" +CONF_SPECIFIED=false + +arg_count=1 +eval SWITCH=\${$arg_count} +while [ ! -z "$SWITCH" ] +do + + if [ "$SWITCH" = "-c" ]; then + eval JBOSSCONF=\$`expr $arg_count + 1` + CONF_SPECIFIED=true + break + fi + + echo "$SWITCH" | grep "^\-\-configuration=" > /dev/null + if [ $? -eq 0 ]; then + JBOSSCONF=`echo $SWITCH|sed 's/\-\-configuration=//'` + break + fi + + arg_count=`expr $arg_count + 1` + eval SWITCH=\${$arg_count} +done + +if [ x${CONF_SPECIFIED} = "xfalse" ] +then + set -- "-c" ${JBOSSCONF} $@ +fi + # Use the maximum available, or set MAX_FD != -1 to use that MAX_FD="maximum" @@ -49,7 +79,12 @@ # Read an optional running configuration file if [ "x$RUN_CONF" = "x" ]; then - RUN_CONF="$DIRNAME/run.conf" + + if [ ! -z "$JBOSSCONF" ] && [ -f "$DIRNAME/../server/$JBOSSCONF/run.conf" ]; then + RUN_CONF="$DIRNAME/../server/$JBOSSCONF/run.conf" + else + RUN_CONF="$DIRNAME/run.conf" + fi fi if [ -r "$RUN_CONF" ]; then . "$RUN_CONF"