#!/usr/bin/env bash

siteserverip="`/opt/dosis2/bin/xml-select read \
    /opt/dosis2/etc/custom/dosisConfig.xml \
    --select 'config > section[name="general"] > property[name="DBServer"] > value' \
    --text`"
if [ "${siteserverip}" = "" ]; then
    siteserverip="`/opt/dosis2/bin/xml-select read \
        /opt/dosis2/etc/dosisConfig.xml \
        --select 'config > section[name="general"] > property[name="DBServer"] > value' \
        --text`"
fi

printf "${siteserverip}" | tr -d '\n' | sed -E -e 's/^\s+//g' -e 's/\s+$//g'
