#!/bin/sh

if [ -z $VMM_HOME ]
then
  savewd=`pwd`
  cd `dirname $0`
  zdir=`pwd`
  cd $savewd
  VMM_HOME=`dirname $zdir`
  export VMM_HOME
fi

if [ -z "$JAVA_HOME" ]
then
    JAVA=java
else
    JAVA=$JAVA_HOME/bin/java
fi

CLASSPATH=$VMM_HOME/etc:$VMM_HOME/lib:$VMM_HOME/lib/vmmagent.jar

JAVA_OPTS=-Dvmm.home="$VMM_HOME"

$JAVA  $JAVA_OPTS -cp $CLASSPATH org.ow2.jasmine.vmm.agent.main.VirtManagerAgent
