Home | History | Annotate | Download | only in dhc
      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 
     23 #
     24 # Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
     25 # Use is subject to license terms.
     26 #
     27 # ident	"@(#)dhcp_register.ksh	1.4	07/06/06 SMI"
     28 #
     29 
     30 . `dirname $0`/dhcp_config
     31 
     32 #
     33 # Validation
     34 #
     35 
     36 # Validate if both NETWORK and USE_STATIC_DHCP is being set
     37 
     38 if [ ! -z "${NETWORK}" -a  "${USE_STATIC_DHCP}" = "TRUE" ]; then
     39 
     40    echo "Configure both NETWORK and USE_STATIC_DHCP is not allowed"
     41    exit 1
     42 fi
     43 
     44 if [ ! -z "${NETWORK}" ]; then
     45    USED_NETWORK="-N "${NETWORK}
     46 else
     47    USED_NETWORK="-S"
     48 fi
     49 
     50 if [ "${USE_CGTP}" = "TRUE" ]; then
     51    USE_CGTP="-T"
     52 else
     53    USE_CGTP=""
     54 fi
     55 
     56 if [ ! -z "${TEST_CLIENTID}" ]; then
     57    TEST_CLIENTID="-D ${TEST_CLIENTID}"
     58 else
     59    TEST_CLIENTID=""
     60 fi
     61 
     62 if [ ! -z "${TFTPTESTFILE}" ]; then
     63    TFTPTESTFILE="-F ${TFTPTESTFILE}"
     64 else
     65    TFTPTESTFILE=""
     66 fi
     67 
     68 
     69 
     70 scrgadm -a -j $RS -g $RG -t SUNW.gds \
     71 -x Start_command="/opt/SUNWscdhc/bin/start_dhcp \
     72 -R $RS -G $RG ${USED_NETWORK} ${USE_CGTP} ${TEST_CLIENTID} ${TFTPTESTFILE}" \
     73 -x Stop_command="/opt/SUNWscdhc/bin/stop_dhcp \
     74 -R $RS -G $RG ${USED_NETWORK} ${USE_CGTP} ${TEST_CLIENTID} ${TFTPTESTFILE}" \
     75 -x Probe_command="/opt/SUNWscdhc/bin/probe_dhcp \
     76 -R $RS -G $RG ${USED_NETWORK} ${USE_CGTP} ${TEST_CLIENTID} ${TFTPTESTFILE}" \
     77 -y Port_list=$PORT/tcp -y Network_resources_used=$LH \
     78 -x Stop_signal=9 \
     79 -y Resource_dependencies=$HAS_RS -x Child_mon_level=3
     80