Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: ca-87377
Fetching contributors…

Cannot retrieve contributors at this time

executable file 29 lines (23 sloc) 0.72 kB
#!/bin/bash
# Script which obtains xensource base path.
# Citrix Systems Inc, 2011
#
# Notes:
# - The configuration file "xapi.conf" is first looked for in "/etc",
# and, if not found there, in the same directory as the script itself.
# - If the configuration file doesn't contain the "base_path" property,
# the value returned defaults to "/opt/xensource".
DEFAULT_CONF="/etc/xapi.conf"
if [ -e "${DEFAULT_CONF}" ]; then
CONF=${DEFAULT_CONF}
else
SCRIPTS_DIR=`dirname ${0}`
CONF="${SCRIPTS_DIR}/xapi.conf"
fi
if [ -e "${CONF}" ]; then
BASE_PATH=`grep "^[^#]" "${CONF}" | grep "base_path" | awk -F '=' '{print $2}'`
fi
if [ -z "${BASE_PATH}" ]; then
BASE_PATH="/opt/xensource"
fi
echo -n ${BASE_PATH}
Jump to Line
Something went wrong with that request. Please try again.