#!/bin/ksh93
# IBM_PROLOG_BEGIN_TAG 
# This is an automatically generated prolog. 
#  
# 61haes_r714 src/43haes/lib/ksh93/OEMVeritas/KLIB_OEMVeritas_getDiskGroupState.sh 1.6 
#  
# Licensed Materials - Property of IBM 
#  
# Restricted Materials of IBM 
#  
# COPYRIGHT International Business Machines Corp. 2005,2011 
# All Rights Reserved 
#  
# US Government Users Restricted Rights - Use, duplication or 
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp. 
#  
# IBM_PROLOG_END_TAG 
# @(#)09	1.6 src/43haes/lib/ksh93/OEMVeritas/KLIB_OEMVeritas_getDiskGroupState.sh, hacmp.utils, 61haes_r714 11/28/11 15:02:08
function KLIB_OEMVeritas_getDiskGroupState {
	. /usr/es/lib/ksh93/func_include

	typeset dg=$1

	if [[ ! -f /usr/sbin/vxdg || ! -x /usr/sbin/vxdg ]]; then
		return 1
	fi

	LC_ALL=C /usr/sbin/vxdg list | while read name state id; do
		if [[ "$name" != "NAME" && "$name" == "$dg" ]]; then
			echo $name
		fi
	done
	return 0
}
