#!/usr/bin/ksh # # CDDL HEADER START # # The contents of this file are subject to the terms of the # Common Development and Distribution License (the License). # You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/CDDL.txt # or http://www.opensolaris.org/os/licensing. # See the License for the specific language governing permissions # and limitations under the License. # # When distributing Covered Code, include this CDDL HEADER in each # file and include the License file at usr/src/CDDL.txt. # If applicable, add the following below this CDDL HEADER, with the # fields enclosed by brackets [] replaced with your own identifying # information: Portions Copyright [yyyy] [name of copyright owner] # # CDDL HEADER END # # Copyright 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # #ident "%Z%%M% %I% %E% SMI" # MYNAME=$(basename ${0}) MYDIR=$(dirname ${0}) METHOD="validate" MACH="$(/usr/bin/uname -p)" typeset -rx TEXTDOMAIN=SUNW_SC_XVM typeset -rx TEXTDOMAINDIR=/opt/SUNWscxvm/lib/locale case "${MACH}" in i386*) VM=xvm PROPS="Domain_name Migration_type Plugin_probe Debug_level" ;; sparc*) VM=ldom PROPS="Domain_name Migration_type Plugin_probe Password_file Debug_level" ;; *) ;; esac . ${MYDIR}/functions typeset opt typeset -i rc=0 typeset -i update=0 while getopts 'cur:x:X:g:R:G:T:' opt do case "${opt}" in u) # set update update=1 ;; x) # Extension properties property_key=$(echo ${OPTARG} | ${AWK} -F= '{print $1}' | ${TR} [a-z] [A-Z]) property_value=$(echo ${OPTARG} | ${AWK} -F= '{print $2}') case "${property_key}" in DOMAIN_NAME) DOMAIN=${property_value};; MIGRATION_TYPE) MIGRATION_TYPE=${property_value};; PLUGIN_PROBE) PLUGIN_PROBE=${property_value};; PASSWORD_FILE) PASSWORD_FILE=${property_value};; DEBUG_LEVEL) DEBUG_LEVEL=${property_value};; esac ;; X) # Per_node extension properties ;; g) # Resource group properties ;; R) RESOURCE=${OPTARG};; G) RESOURCEGROUP=${OPTARG};; T) RESOURCETYPE=${OPTARG};; esac done if [[ ${update} == 1 ]] then if ! get_properties ${PROPS} then debug_message "Method: $(basename ${0}) - End (Exit 1)" exit 1 fi fi debug_message "Method: $(basename ${0}) - Begin" $SET_DEBUG if ! validate then debug_message "Method: $(basename ${0}) - End (Exit 1)" exit 1 fi debug_message "Method: $(basename ${0}) - End (Exit 0)" exit 0