Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: assert_can_mig…
Fetching contributors…

Cannot retrieve contributors at this time

executable file 28 lines (23 sloc) 0.72 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
#!/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}
Something went wrong with that request. Please try again.