New ids_register.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   "@(#)ids_register.ksh 1.4     08/05/27 SMI"
 26 #
 27 #       DO NOT EDIT THIS FILE
 28 
 29 IDSDIR=/opt/SUNWscids/
 30 
 31 typeset opt
 32 
 33 while getopts 'f:' opt
 34 do
 35         case "$opt" in
 36            f)   MYCONFIG=${OPTARG};;
 37            *)   /usr/bin/echo "ERROR: ${MYNAME} Option ${OPTARG} unknown"
 38                 /usr/bin/echo "Usage: ${MYNAME} -f <config file>"
 39                 exit 1;;
 40         esac
 41 done
 42 
 43 [ -z "${MYCONFIG}" ] && MYCONFIG=/opt/SUNWscids/util/ids_config
 44 
 45 . ${MYCONFIG}
 46 
 47 for variable in RS RG LH_RS HAS_RS USERID INFORMIXDIR ONCONFIG INFORMIXSERVER INFORMIXSQLHOSTS
 48 do
 49         if eval [ -z \$${variable} ]
 50         then
 51            /usr/bin/printf "IDS requires a value for ${variable}= within ${MYCONFIG}\n"
 52            rc=1
 53         fi
 54 done
 55 
 56 [ "${rc}" -ne 0 ] && exit 1
 57 
 58 /usr/cluster/bin/clrs create -g ${RG} -t SUNW.gds \
 59 -p Start_command="/opt/SUNWscids/bin/control_ids \
 60 -R '${RS}' -G '${RG}' -U '${USERID}' -D '${INFORMIXDIR}' -C '${ONCONFIG}' \
 61 -S '${INFORMIXSERVER}' -H '${INFORMIXSQLHOSTS}' start ids " \
 62 -p Stop_command="/opt/SUNWscids/bin/control_ids \
 63 -R '${RS}' -G '${RG}' -U '${USERID}' -D '${INFORMIXDIR}' -C '${ONCONFIG}' \
 64 -S '${INFORMIXSERVER}' -H '${INFORMIXSQLHOSTS}' stop ids " \
 65 -p Probe_command="/opt/SUNWscids/bin/control_ids \
 66 -R '${RS}' -G '${RG}' -U '${USERID}' -D '${INFORMIXDIR}' -C '${ONCONFIG}' \
 67 -S '${INFORMIXSERVER}' -H '${INFORMIXSQLHOSTS}' probe ids " \
 68 -p Validate_command="/opt/SUNWscids/bin/control_ids \
 69 -R '${RS}' -G '${RG}' -U '${USERID}' -D '${INFORMIXDIR}' -C '${ONCONFIG}' \
 70 -S '${INFORMIXSERVER}' -H '${INFORMIXSQLHOSTS}' validate ids " \
 71 -p Port_list=23/tcp -p Stop_signal=9 \
 72 -y Resource_dependencies=${HAS_RS},${LH_RS} \
 73 ${RS}
 74 
 75 rc=$?
 76 
 77 exit ${rc}