New control_xvm.ksh
  1 #!/usr/bin/ksh
  2 #
  3 # CDDL HEADER START
  4 #
  5 # The contents of this file are subject to the terms of the
  6 # Common Development and Distribution License (the License).
  7 # You may not use this file except in compliance with the License.
  8 #
  9 # You can obtain a copy of the license at usr/src/CDDL.txt
 10 # or http://www.opensolaris.org/os/licensing.
 11 # See the License for the specific language governing permissions
 12 # and limitations under the License.
 13 #
 14 # When distributing Covered Code, include this CDDL HEADER in each
 15 # file and include the License file at usr/src/CDDL.txt.
 16 # If applicable, add the following below this CDDL HEADER, with the
 17 # fields enclosed by brackets [] replaced with your own identifying
 18 # information: Portions Copyright [yyyy] [name of copyright owner]
 19 #
 20 # CDDL HEADER END
 21 #
 22 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 23 # Use is subject to license terms.
 24 #
 25 #ident   "@(#)control_xvm.ksh 1.1     08/11/19 SMI"
 26 #
 27 # Usage GDS: <parameter> <options>
 28 #
 29 #       parameter: start | stop | probe | validate
 30 #       <options>: -R <resource> -G <resourcegroup> etc.
 31 
 32 MYNAME=`/usr/bin/basename $0`
 33 MYDIR=`/usr/bin/dirname $0`
 34 
 35 . ${MYDIR}/../etc/config
 36 
 37 METHOD=${1}
 38 
 39 shift ${OPTIND}
 40 
 41 typeset opt
 42 
 43 while getopts 'R:G:D:M:P:A:' opt
 44 do
 45         case "${opt}" in
 46                 R)      RESOURCE=${OPTARG};;
 47                 G)      RESOURCEGROUP=${OPTARG};;
 48                 D)      DOMAIN=${OPTARG};;
 49                 M)      FAILOVER_TYPE=${OPTARG};;
 50                 P)      PLUGIN_PROBE=${OPTARG};;
 51                 A)      ADMIN=${OPTARG};;
 52                 *)      exit 1;;
 53         esac
 54 done
 55 
 56 
 57 . ${MYDIR}/functions
 58         
 59 debug_message "Method: ${MYNAME} - Begin"
 60 ${SET_DEBUG}
 61 
 62 case "${METHOD}" in
 63         start)
 64                 start_domain
 65                 rc=$?
 66                 ;;
 67                 
 68         stop)
 69                 stop_domain
 70                 rc=$?
 71                 ;;
 72 
 73         probe)
 74                 check_domain
 75                 rc=$?
 76                 ;;
 77         validate)
 78                 validate
 79                 rc=$?
 80                 ;;
 81 esac
 82 
 83 debug_message "Method: ${MYNAME} - End"
 84 exit ${rc}