#!/bin/ksh
# IBM_PROLOG_BEGIN_TAG 
# This is an automatically generated prolog. 
#  
# 61haes_r714 src/43haes/usr/sbin/cluster/cspoc/utilities/cl_getvpathmajor.sh 1.3 
#  
# Licensed Materials - Property of IBM 
#  
# COPYRIGHT International Business Machines Corp. 2002,2007 
# 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 
# @(#)32        1.3 src/43haes/usr/sbin/cluster/cspoc/utilities/cl_getvpathmajor.sh, hacmp.cspoc, 61haes_r714 2/1/07 13:17:00
# \$Id\$

#
#	Component:	hacmp.cspoc
#
#	Function:	Outputs free disk major number using the temp
#			file /tmp/cllsvpathids.out
#
#	Origins:	27
#
#	Arguments:	None
#
#	Output:		Next free major number
#
#	Usage:		cl_getvpathmajor
#
#	Return Values:	0 - success
#			
#############################################################################

CL_DATFILE="/tmp/cllsvpathids.out"
MAXMAJOR=`grep FREEMAJORS $CL_DATFILE | cut -f1,3 -d":" | awk -F: '{print $NF} ' | awk -F, '{print $NF}' |  sed 's/ //g' | cut -f1 -d"." | sort -u -n | tail -1`

echo `expr $MAXMAJOR + 1`;

exit 0
