#
# 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
#
#
# 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.
#
# util functions used by scripts
# set up variables
# source the config file if present
if [[ -f $confFile ]]
then
fi
function fixUser
{
# set user to $(whoami) if not specified
if [[ -z ${user} ]]
then
fi
# sudo
then
exit $?
fi
if [[ "${oldwhoami}" == "" ]]
then
fi
}
function setStartTime
{
if [[ "${OS}" == "SunOS" ]]
then
else
fi
}
function timeStamp
{
date +'%Y/%m/%d %H:%M:%S'
}
function curlUrl
{
curl_url=""
if [[ -n ${solr_url} ]]
then
else
if [[ -z ${solr_port} ]]
then
echo "Solr port number missing in $confFile or command line."
echo "$USAGE"
exit 1
fi
# use default hostname if not specified
if [[ -z ${solr_hostname} ]]
then
fi
# use default webapp name if not specified
if [[ -z ${webapp_name} ]]
then
fi
curl_url=http://${solr_hostname}:${solr_port}/${webapp_name}/update
fi
}
function dataDir
{
# use default value for data_dir if not specified
# relative path starts at ${solr_root}
if [[ -z ${data_dir} ]]
then
then
fi
}
function logMessage
{
if [[ -n ${verbose} ]]
then
echo $@
fi
}
function logExit
{
if [[ "${OS}" == "SunOS" ]]
then
else
fi
exit $2
}
# create logs directory if not there
then
fi
umask 002