#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# See LICENSE.txt included in this distribution for the specific
# language governing permissions and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
# Copyright 2010 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
read value
if [ "x$value" != 'x""' ]; then
printf "%s" "$value"
fi
)
}
read_config() {
SRCDIR=`getprop srcdir`
if [ ! -d "$SRCDIR" ]; then
exit $SMF_EXIT_ERR_CONFIG
fi
JAVA_EXTRA_PARAMS=`getprop java_extra_params`
OG_DEF_PARAMS=`getprop default_params`
OG_EXTRA_PARAMS=`getprop extra_params`
READONLY_CFG_FILE=`getprop readonly_config`
READ_XML_CONF=""
VERBOSE=""
VERBOSE="-v"
fi
fi
}
CLASSPATH=$LIBDIR/opengrok.jar
xx() {
echo "$@"
"$@"
}
runjava() {
xx ${JAVA} ${JAVA_OPTS} ${JAVA_EXTRA_PARAMS} \
-cp ${CLASSPATH} \
${OG_DEF_PARAMS} ${OG_EXTRA_PARAMS} \
${READ_XML_CONF} \
-W ${XML_CONFIGURATION} \
${WEBAPP_CONFIG_ADDRESS} \
${VERBOSE} \
-s ${SRCDIR} -d ${DATADIR} "$@"
}
# Read configuration for the first time.
read_config || exit $?
pipe=/var/opengrok/.refresh.pipe
fi
# This is likely our first run. Let's do the initial indexing.
runjava -H || exit 1
fi
while read line; do
# Re-read configuration.
read_config || exit $?
runjava -H || exit 1