#!/bin/sh
#
#    Licensed to the Apache Software Foundation (ASF) under one or more
#    contributor license agreements_  See the NOTICE file distributed with
#    this work for additional information regarding copyright ownership_
#    The ASF licenses this file to You under the Apache License, Version 2_0
#    (the "License"); you may not use this file except in compliance with
#    the License_  You may obtain a copy of the License at
#
#       http://www_apache_org/licenses/LICENSE-2_0
#
#    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_
#

#
# handle specific scripts; the SCRIPT_NAME is exactly the name of the Karaf
# script: client, instance, shell, start, status, stop, karaf
#
# if [ "${KARAF_SCRIPT}" == "SCRIPT_NAME" ]; then
#   Actions go here___
# fi

#
# general settings which should be applied for all scripts go here; please keep
# in mind that it is possible that scripts might be executed more than once, e_g_
# in example of the start script where the start script is executed first and the
# karaf script afterwards_
#

#
# The following section shows the possible configuration options for the default
# karaf scripts
#
# export JAVA_HOME # Location of Java installation
# export JAVA_MIN_MEM # Minimum memory for the JVM
# export JAVA_MAX_MEM # Maximum memory for the JVM
# export JAVA_PERM_MEM # Minimum perm memory for the JVM
# export JAVA_MAX_PERM_MEM # Maximum perm memory for the JVM
# export EXTRA_JAVA_OPTS # Additional JVM options
# export KARAF_HOME # Karaf home folder
# export KARAF_DATA # Karaf data folder
# export KARAF_BASE # Karaf base folder
# export KARAF_ETC  # Karaf etc  folder
# export KARAF_LOG  # Karaf log  folder
# export KARAF_SYSTEM_OPTS # First citizen Karaf options
# export KARAF_OPTS # Additional available Karaf options
# export KARAF_DEBUG # Enable debug mode
# export KARAF_REDIRECT # Enable/set the std/err redirection when using bin/start
# export KARAF_NOROOT # Prevent execution as root if set to true

# set JAVA_HOME by calling central java_home path setter
JAVA_HOME_PATH_SETTER="$DIRNAME/../../java_home_path_setter.sh"
if [ -f "$JAVA_HOME_PATH_SETTER" ]
then
  . "$JAVA_HOME_PATH_SETTER"
fi

BPC_ENV="$DIRNAME/../../bpc.env.sh"
if [ -f "$BPC_ENV" ]
then
  echo "load bpc.env.sh"
  . "$BPC_ENV"
fi
