#!/usr/bin/ksh
#
# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#


MYNAME=`basename ${0}`
MYDIR=`dirname ${0}`

. ${MYDIR}/../etc/config
. ${MYDIR}/../../lib/functions_static
. ${MYDIR}/functions

USE_INTERNAL_DEP=TRUE

debug_message "Method: `basename $0` - Begin"
$SET_DEBUG

typeset opt

while getopts 'R:G:P:Z' opt
do
        case "$opt" in
                R)      RESOURCE=$OPTARG;;
                G)      RESOURCEGROUP=$OPTARG;;
		P)	PARFILE=$OPTARG;;
		Z)	USE_INTERNAL_DEP=FALSE;;
                *)      exit 1;;
        esac
done

# exit from start, if the options are wrong

validate_options
rc_val=${?}
if [ ${rc_val} -ne 0 ]
then
	exit 100
fi

if ! validate
then
        debug_message "Method: `basename $0` - End (Exit 100)"
        exit 100
fi

# Source the Sun One Provisioning Server specific parameter file
. ${PARFILE}

if ! check_spsma
then
	debug_message "Method: `basename $0` - End (Exit 100)"
	exit 100
fi

debug_message "Method: `basename $0` - End (Exit 0)"
exit 0
