#!/bin/sh
#
# Licensed to JumpMind Inc under one or more contributor
# license agreements.  See the NOTICE file distributed
# with this work for additional information regarding
# copyright ownership.  JumpMind Inc licenses this file
# to you under the GNU General Public License, version 3.0 (GPLv3)
# (the "License"); you may not use this file except in compliance
# with the License.
#
# You should have received a copy of the GNU General Public License,
# version 3.0 (GPLv3) along with this library; if not, see
# <http://www.gnu.org/licenses/>.
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
#

dp0="`dirname "$0"`/.."
SYM_HOME="`cd "$dp0" && pwd`"
export SYM_HOME

SYM_OPTIONS="-Dfile.encoding=utf-8 \
-Duser.language=en \
-Djava.io.tmpdir=$SYM_HOME/tmp \
-Dorg.eclipse.jetty.server.Request.maxFormContentSize=800000 \
-Dorg.eclipse.jetty.server.Request.maxFormKeys=100000 \
-Dsym.keystore.file=$SYM_HOME/security/keystore \
-Djavax.net.ssl.trustStore=$SYM_HOME/security/cacerts \
-Djavax.net.ssl.keyStorePassword=obf:WmFwKlZjKjdu \
-Dlog4j2.configurationFile=file:$SYM_HOME/conf/log4j2.xml \
-Dsun.net.client.defaultReadTimeout=300000 \
-Dsun.net.client.defaultConnectTimeout=300000 \
-Djava.net.preferIPv4Stack=true \
-Dcom.ibm.as400.access.AS400.guiAvailable=false \
-Dsymmetric.ssl.ignore.ciphers=TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA,TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA,SSL_RSA_WITH_3DES_EDE_CBC_SHA,TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA,TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA,SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA,SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA \
-XX:+HeapDumpOnOutOfMemoryError \
-XX:HeapDumpPath=$SYM_HOME/tmp \
-Xms2500M \
-Xmx2500M"
export SYM_OPTIONS

SYM_JAVA=java
if [ "$JAVA_HOME" != "" ]
then
   SYM_JAVA="$JAVA_HOME/bin/java"
fi
export SYM_JAVA

SEP=:
if uname | grep -i cygwin > /dev/null
then
   SEP=";"
fi

CLASSPATH="$SYM_HOME/patches$SEP$SYM_HOME/patches/*$SEP$SYM_HOME/lib/*$SEP$SYM_HOME/web/WEB-INF/lib/*"
export CLASSPATH

