#!/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

BGRAD_HOME_DIALUP=.

CLASSPATH=$BGRAD_HOME_DIALUP:$BGRAD_HOME_DIALUP/lib/*

if [ "$1" = "start" ]; then
	nohup  ${JAVA_HOME}/bin/java -Djava.net.preferIPv4Stack=true -Dapp.name=BGRadiusDialup -Xmx256m -Dlog4j.configuration=log4j-radius.xml -Dlog.dir.path=log/ -cp $CLASSPATH bitel.billing.server.radius.Radius $1 $2 $3 $4 $5 $6 > ./log/radius.out 2>&1 &
else
	${JAVA_HOME}/bin/java -Djava.net.preferIPv4Stack=true -Xmx256m -cp $CLASSPATH bitel.billing.server.radius.Radius $1 $2 $3 $4 $5 $6
fi

