Skip to content

Commit

Permalink
Cleaning up script output, support for MIDPOINT_HOME env
Browse files Browse the repository at this point in the history
  • Loading branch information
semancik committed Dec 5, 2017
1 parent a06b921 commit fa38d7e
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions dist/src/main/bin/springboot.sh
Expand Up @@ -17,7 +17,10 @@

SCRIPT_PATH=$(cd $(dirname "$0") && pwd -P)/$(basename "$2")
USE_NOHUP="true"
JAVA_OPTS="$JAVA_OPTS -Xms2048M -Xmx2048M -XX:PermSize=128m -XX:MaxPermSize=256m -Dmidpoint.home=$SCRIPT_PATH../var"
if [ -z "$MIDPOINT_HOME" ] ; then
MIDPOINT_HOME="$SCRIPT_PATH../var"
fi
JAVA_OPTS="$JAVA_OPTS -Xms2048M -Xmx2048M -XX:PermSize=128m -XX:MaxPermSize=256m -Dmidpoint.home=$MIDPOINT_HOME"

# resolve links - $0 may be a softlink
PRG="$0"
Expand All @@ -35,7 +38,7 @@ done
# Get standard environment variables
PRGDIR=`dirname "$PRG"`

cd "$PRGDIR/.." >/dev/null; pwd
cd "$PRGDIR/.." >/dev/null

cd "$SCRIPT_PATH/.."

Expand All @@ -44,8 +47,7 @@ if [ ! -d var ] ; then
mkdir var/log
fi

if [ -z "$BOOT_OUT" ] ; then

if [ -z "$BOOT_OUT" ] ; then
BOOT_OUT="$SCRIPT_PATH"../var/log/springboot.out
fi

Expand Down Expand Up @@ -88,13 +90,14 @@ if [ "$USE_NOHUP" = "true" ]; then
_NOHUP=nohup
fi


# ----- Execute The Requested Command -----------------------------------------

if [ $have_tty -eq 1 ]; then
if [ ! -z "$SPRING_PID" ]; then
echo "Using SPRING_PID: $SPRING_PID"
fi
fi
#if [ $have_tty -eq 1 ]; then
# if [ ! -z "$SPRING_PID" ]; then
# echo "Using SPRING_PID: $SPRING_PID"
# fi
#fi

if [ "$1" = "start" ] ; then
if [ ! -z "$SPRING_PID" ]; then
Expand Down Expand Up @@ -140,6 +143,9 @@ if [ $? != 0 ]; then
shift
touch "$BOOT_OUT"

echo "Starting midPoint..."
echo "MIDPOINT_HOME=$MIDPOINT_HOME"

cd
eval $_NOHUP "\"$_RUNJAVA\"" -jar $LOGGING_MANAGER $JAVA_OPTS \
$SCRIPT_PATH../lib/midpoint.war \
Expand All @@ -150,7 +156,6 @@ if [ ! -z "$SPRING_PID" ]; then
echo $! > "$SPRING_PID"
fi

echo "Starting midPoint..."

elif [ "$1" = "stop" ] ; then

Expand Down

0 comments on commit fa38d7e

Please sign in to comment.