#!/bin/bash

set -e

if [ $appName ]; then
    echo "appName is $appName"
else
    export appName="mservice"
fi

if [ $gpfdistBasePort ]; then
    echo "gpfdistBasePort is $gpfdistBasePort"
else
    export gpfdistBasePort=36010
fi

if [ $rpcServerPort ]; then
    echo "rpcServerPort is $rpcServerPort"
else
    export rpcServerPort=8564
fi

if [ $gpfdistLogDir ]; then
    echo "gpfdistLogDir is $gpfdistLogDir"
else
    export gpfdistLogDir="../logs"
fi

if [ $javaIoTmp ]; then
    echo "javaIoTmp is $javaIoTmp"
else
    export javaIoTmp="../temp"
fi

export BOOTCLASS="com.kingdee.bos.qing.dpp.gpfdist.MainEntry"

export JAVA_APP_OPTS=" -DclusterName=$clusterName -Djava.io.tmpdir=$javaIoTmp -DappName=$appName -DconfigUrl=$configUrl -DQingAnalysis.TempDir=$qingStorageDir -Dqing.gpfdist.logDir=$gpfdistLogDir -Dqing.gpfdist.basePort=$gpfdistBasePort"