#!/usr/bin/env bash

if [ -f "/opt/dosis2/etc/custom/dosisConfig.xml" ]; then
    dafe_type="`/opt/dosis2/bin/xml-select read /opt/dosis2/etc/custom/dosisConfig.xml \
        --select 'config > section[name=\"general\"] > property[name=\"DafeType\"] > value' --text`"
else
    dafe_type=""
fi

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

if [ "${dafe_type}" = "" ]; then
    dafe_type="L60"
fi

echo "${dafe_type}"
