#!/bin/bash

source ./common.sh

mkdir -p logs

if [ -f "custom_init.sh" ]; then
    source ./custom_init.sh
fi


if [[ IS_DEV_ENV -eq 1 ]]; then
    java -jar -agentlib:jdwp=transport=dt_socket,server=y,suspend=${DEBUG_SUSPEND},address=${DEBUG_PORT} \
         ${JAVA_OPTS} -Dinstance_id="$1" new_${JAR_NAME}
else
    java -jar ${JAVA_OPTS} -Dinstance_id="$1" ${JAR_NAME} >> logs/app-$1.out 2>&1 &
fi
