#!/bin/sh

# Check if $JONAS_ROOT is set.
if [ ! -d "$JONAS_ROOT" ]; then
    echo Please set the JONAS_ROOT variable.
    exit
fi

# Check if $JONAS_BASE is set.
if [ ! -d "$JONAS_BASE" ]; then
    JONAS_BASE=$JONAS_ROOT
fi

PATH=$JONAS_ROOT\bin:$PATH

rm $JONAS_BASE\deploy\zz_jasmine-monitoring-online.xml

jonas start -clean -Djonas.felix.configuration.file=config.properties &

sleep 25

echo
echo Deploying JASMINe Monitoring ...

cp $JONAS_BASE\zz_jasmine-monitoring-online.xml $JONAS_BASE\deploy