#!/bin/sh
# $Id$
#
# Script:	ldom_lookup
#
# Description:	Logical Domain (LDom) lookup script
#
# Platform:	Solaris 10/LDom
#
# Author:	High-Availability.Com Ltd
#
servername=`uname -n`
failoverldom=false

. /opt/HAC/bin/rsf.sh

#
# One large case statement to figure out from a service name what the
# ldom hostname is (a 1-1 mapping) and then which server is running
# the ldom ($servername) and from this what the ldomname is (and if
# it is the failover ldom).
#
# The first case statement is for example purposes. Update this one 
# then add further "cases" below.
#
case "${RSF_SERVICE}" in
'oratest')
	ldomhostname="oratest-01" # ldom host name for oratest

	if match "${servername}" "sbc-t5k-3"; then
		ldomname="oratest-01"
	else
		ldomname="fo-oratest"
		failoverldom=true
	fi
	;;
esac

export ldomhostname failoverldom