#!/bin/sh

cd ${0%${0##*/}}.

if [ -z "$JAVA_HOME" ]; then
  echo "The JAVA_HOME environment variable is not defined"
  echo "This environment variable is needed to run this program"
  exit 1
fi

BGIPN_NETFLOW_HOME=.
CLASSPATH=${BGIPN_NETFLOW_HOME}:${BGIPN_NETFLOW_HOME}/lib/*

if [ "$1" = "start" ]; then
    nohup  ${JAVA_HOME}/bin/java -Dapp.name=BGIPNNetflowCollector -Dlog4j.configuration=log4j-collector.xml -Dlog.dir.path=log/ -Dnetworkaddress.cache.ttl=3600 -Xmx256m -Djava.awt.headless=true -cp ${CLASSPATH}  bitel.billing.server.netflow.ipn.Collector $1 $2 $3   > ./log/netflow.out 2>&1 &
else
	${JAVA_HOME}/bin/java -Dnetworkaddress.cache.ttl=3600 -Xmx256m -Djava.awt.headless=true -cp ${CLASSPATH}  bitel.billing.server.netflow.ipn.Collector $1 $2 $3 $4 $5
fi