#!/bin/bash

CMDNAME=`basename "$0"`

SOLR_PATH=@solr_path@

# If not already defined, export these environment variables for bin/solr
# see bin/solr start -help
if [ -z "$SOLR_HOME" ]; then export SOLR_HOME=@solr_home@; fi
if [ -z "$SOLR_DATA_HOME" ]; then export SOLR_DATA_HOME=@solr_data_home@; fi
if [ -z "$SOLR_LOGS_DIR" ]; then export SOLR_LOGS_DIR=@solr_logs_dir@; fi
if [ -z "$SOLR_PID_DIR" ]; then export SOLR_PID_DIR=@solr_pid_dir@; fi
if [ -z "$SOLR_PORT" ]; then export SOLR_PORT=@solr_port@; fi
if [ -z "$SOLR_HEAP" ]; then export SOLR_HEAP=@solr_heap@; fi
# if [ -z "$SOLR_JAVA_MEM" ]; then export SOLR_JAVA_MEM=@solr_java_mem@; fi
if [ -z "$SOLR_LOG_PRESTART_ROTATION" ]; then export SOLR_LOG_PRESTART_ROTATION=@solr_log_prestart_rotation@; fi
if [ -z "$SOLR_ULIMIT_CHECKS" ]; then export SOLR_ULIMIT_CHECKS=@solr_ulimit_checks@; fi
 
# this shell function is not used, but instructive here
usage() {
    echo "Usage: See ${SOLR_PATH}/bin/solr" 1>&2
    exit 1
}

${SOLR_PATH}/bin/solr $*
