Sdiff sczbt_register.ksh


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 23 # 24 # Copyright 2007 Sun Microsystems, Inc. All rights reserved. 25 # Use is subject to license terms. 26 # 27 #ident "%Z%%M% %I% %E% SMI" 28 # 29 # This script has the optional -f option: 30 # -f <filename> sources a user definable config file 31 # different from sczbt_config. 32 33 MYNAME=`basename ${0}` 34 35 typeset opt 36 37 while getopts 'f:' opt 38 do 39 case "${opt}" in 40 f) MYCONFIG=${OPTARG};; 41 *) echo "ERROR: ${MYNAME} Option ${OPTARG} unknown - early End. Only -f is valid" 42 exit 1;; 43 esac 44 done
113 # before registering this resource within Sun Cluster. 114 # 115 116 Zonename="${Zonename}" 117 Zonebrand="${Zonebrand}" 118 Zonebootopt="${Zonebootopt}" 119 Milestone="${Milestone}" 120 LXrunlevel="${LXrunlevel}" 121 SLrunlevel="${SLrunlevel}" 122 Mounts="${Mounts}" 123 EOF 124 125 else 126 echo "The parameterfile ${PARAMETERDIR}/sczbt_${RS} already exists! Will not overwrite and exit." 127 exit 1 128 fi 129 130 131 # Checking dependencies for SC_NETWORK=true 132 133 SC_NETWORK=`echo ${SC_NETWORK}|/usr/bin/tr [:upper:] [:lower:]` 134 135 if [ "${SC_NETWORK}" == "true" -a -z "${SC_LH}" ] 136 then 137 echo "Error: SC_LH is required with SC_NETWORK=true" 138 rm ${PARAMETERDIR}/sczbt_${RS} 139 exit 1 140 fi 141 142 # If the configured zone has set ip-type=exclusive, then assigning a 143 # SUNW.LogicalHostname to this zone is not possible. 144 145 IPTYPE=`/usr/sbin/zonecfg -z ${Zonename} info | /bin/grep "^ip-type:" | /bin/awk '{print $2}'` 146 147 if [ "${IPTYPE}" == "exclusive" ] && [ "${SC_NETWORK}" == "true" ] 148 then 149 echo "Error: The zone ${Zonename} has set ip-type=exclusive. This can not be combined with setting SC_NETWORK=true." 150 rm ${PARAMETERDIR}/sczbt_${RS} 151 exit 1 152 fi 153 154 # Checking dependencies for FAILOVER=true 155 156 FAILOVER=`echo ${FAILOVER}|/usr/bin/tr [:upper:] [:lower:]` 157 158 if [ "${FAILOVER}" == "true" -a -z "${HAS_RS}" ] 159 then 160 echo "Error: HAS_RS is required with FAILOVER=true" 161 rm ${PARAMETERDIR}/sczbt_${RS} 162 exit 1 163 fi 164 165 # Setting Resource_dependencies 166 167 if [ "${SC_LH}" ] 168 then 169 RESOURCE_DEPENDENCIES="-y Resource_dependencies=${SC_LH}" 170 else 171 RESOURCE_DEPENDENCIES= 172 fi 173 174 if [ "${HAS_RS}" ] 175 then 176 if [ "${RESOURCE_DEPENDENCIES}" ]


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 23 # 24 # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 25 # Use is subject to license terms. 26 # 27 #ident "%Z%%M% %I% %E% SMI" 28 # 29 # This script has the optional -f option: 30 # -f <filename> sources a user definable config file 31 # different from sczbt_config. 32 33 MYNAME=`basename ${0}` 34 35 typeset opt 36 37 while getopts 'f:' opt 38 do 39 case "${opt}" in 40 f) MYCONFIG=${OPTARG};; 41 *) echo "ERROR: ${MYNAME} Option ${OPTARG} unknown - early End. Only -f is valid" 42 exit 1;; 43 esac 44 done
113 # before registering this resource within Sun Cluster. 114 # 115 116 Zonename="${Zonename}" 117 Zonebrand="${Zonebrand}" 118 Zonebootopt="${Zonebootopt}" 119 Milestone="${Milestone}" 120 LXrunlevel="${LXrunlevel}" 121 SLrunlevel="${SLrunlevel}" 122 Mounts="${Mounts}" 123 EOF 124 125 else 126 echo "The parameterfile ${PARAMETERDIR}/sczbt_${RS} already exists! Will not overwrite and exit." 127 exit 1 128 fi 129 130 131 # Checking dependencies for SC_NETWORK=true 132 133 SC_NETWORK=`echo ${SC_NETWORK} | /usr/xpg4/bin/tr [:upper:] [:lower:]` 134 135 if [ "${SC_NETWORK}" == "true" -a -z "${SC_LH}" ] 136 then 137 echo "Error: SC_LH is required with SC_NETWORK=true" 138 rm ${PARAMETERDIR}/sczbt_${RS} 139 exit 1 140 fi 141 142 # If the configured zone has set ip-type=exclusive, then assigning a 143 # SUNW.LogicalHostname to this zone is not possible. 144 145 IPTYPE=`/usr/sbin/zonecfg -z ${Zonename} info | /bin/grep "^ip-type:" | /bin/awk '{print $2}'` 146 147 if [ "${IPTYPE}" == "exclusive" ] && [ "${SC_NETWORK}" == "true" ] 148 then 149 echo "Error: The zone ${Zonename} has set ip-type=exclusive. This can not be combined with setting SC_NETWORK=true." 150 rm ${PARAMETERDIR}/sczbt_${RS} 151 exit 1 152 fi 153 154 # Checking dependencies for FAILOVER=true 155 156 FAILOVER=`echo ${FAILOVER} | /usr/xpg4/bin/tr [:upper:] [:lower:]` 157 158 if [ "${FAILOVER}" == "true" -a -z "${HAS_RS}" ] 159 then 160 echo "Error: HAS_RS is required with FAILOVER=true" 161 rm ${PARAMETERDIR}/sczbt_${RS} 162 exit 1 163 fi 164 165 # Setting Resource_dependencies 166 167 if [ "${SC_LH}" ] 168 then 169 RESOURCE_DEPENDENCIES="-y Resource_dependencies=${SC_LH}" 170 else 171 RESOURCE_DEPENDENCIES= 172 fi 173 174 if [ "${HAS_RS}" ] 175 then 176 if [ "${RESOURCE_DEPENDENCIES}" ]