components/isc-dhcp/isc-dhcp
author Krishnan Chandrashekar <Krishnan.Chandrashekar@oracle.COM>
Tue, 06 Mar 2012 23:55:24 -0800
changeset 722 db6c773d591a
parent 280 c0dae1e3ca2f
child 893 f9f75acab23a
permissions -rw-r--r--
7143416 setting config/append_agent_option to true prevents dhcrelay from starting 7116019 isc-dhcp smf service error for ipv6 relay service 7143373 Remove ISC message from dhcp software.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
280
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
     1
#!/sbin/sh
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
     2
#
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
     3
# CDDL HEADER START
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
     4
#
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
     5
# The contents of this file are subject to the terms of the
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
     6
# Common Development and Distribution License (the "License").
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
     7
# You may not use this file except in compliance with the License.
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
     8
#
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
     9
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    10
# or http://www.opensolaris.org/os/licensing.
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    11
# See the License for the specific language governing permissions
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    12
# and limitations under the License.
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    13
#
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    14
# When distributing Covered Code, include this CDDL HEADER in each
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    15
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    16
# If applicable, add the following below this CDDL HEADER, with the
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    17
# fields enclosed by brackets "[]" replaced with your own identifying
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    18
# information: Portions Copyright [yyyy] [name of copyright owner]
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    19
#
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    20
# CDDL HEADER END
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    21
#
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    22
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    23
#
722
db6c773d591a 7143416 setting config/append_agent_option to true prevents dhcrelay from starting
Krishnan Chandrashekar <Krishnan.Chandrashekar@oracle.COM>
parents: 280
diff changeset
    24
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
280
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    25
#
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    26
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    27
. /lib/svc/share/smf_include.sh
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    28
. /lib/svc/share/net_include.sh
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    29
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    30
SVCPROP=/usr/bin/svcprop
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    31
CHMOD=/usr/bin/chmod
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    32
TOUCH=/usr/bin/touch
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    33
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    34
DHCPD_IPV4="svc:/network/dhcp/server:ipv4"
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    35
DHCPD_IPV6="svc:/network/dhcp/server:ipv6"
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    36
DHCPRELAY_IPV4="svc:/network/dhcp/relay:ipv4"
722
db6c773d591a 7143416 setting config/append_agent_option to true prevents dhcrelay from starting
Krishnan Chandrashekar <Krishnan.Chandrashekar@oracle.COM>
parents: 280
diff changeset
    37
DHCPRELAY_IPV6="svc:/network/dhcp/relay:ipv6"
280
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    38
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    39
DHCPD_BIN="/usr/lib/inet/dhcpd"
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    40
DHCPRELAY_BIN="/usr/lib/inet/dhcrelay"
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    41
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    42
#
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    43
# dhcpd/dhcprelay can run in a global or exclusive-stack zone only
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    44
#
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    45
smf_configure_ip || exit $SMF_EXIT_OK
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    46
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    47
if [ -z $SMF_FMRI ]; then
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    48
	echo "SMF framework variables are not initialized."
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    49
	exit $SMF_EXIT_ERR
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    50
fi
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    51
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    52
#
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    53
# get_prop fmri propname
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    54
#
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    55
get_prop () {
722
db6c773d591a 7143416 setting config/append_agent_option to true prevents dhcrelay from starting
Krishnan Chandrashekar <Krishnan.Chandrashekar@oracle.COM>
parents: 280
diff changeset
    56
	VALUE="`$SVCPROP -cp config/$1 $SMF_FMRI 2>/dev/null`"
280
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    57
	# Empty astring_list values show up as "" - do not return this.
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    58
	if [ "$VALUE" != "\"\"" ]; then
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    59
		echo $VALUE
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    60
	fi
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    61
}
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    62
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    63
errlog () {
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    64
	echo $1 >&2
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    65
}
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    66
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    67
get_common_options() {
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    68
	#
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    69
	# get debug property value 
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    70
	#
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    71
	if [ "`get_prop debug`" = "true" ]; then
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    72
		DEBUG="-d"
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    73
	else
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    74
		DEBUG="-q"
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    75
	fi
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    76
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    77
	export OPTIONS="$OPTIONS $DEBUG"
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    78
	return 0
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    79
}
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    80
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    81
get_dhcpd_options() {
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    82
	# get listen_ifname property value.
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    83
	LISTENIFNAMES="`get_prop listen_ifnames`"
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    84
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    85
	#
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    86
	# get common config file properties
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    87
	#
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    88
	CONFIGFILE=`get_prop config_file`
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    89
	if [ -z "$CONFIGFILE" ]; then
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    90
		errlog "No config_file specified, exiting"
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    91
		return 1
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    92
	fi
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    93
	if [ ! -f "$CONFIGFILE" ]; then
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    94
		errlog "Required config_file $CONFIGFILE not found, exiting"
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    95
		return 1
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    96
	fi
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    97
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    98
	#
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
    99
	# If a leasefile does not exist, create an empty file.
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   100
	#
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   101
	LEASEFILE=`get_prop lease_file`
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   102
	if [ -z "$LEASEFILE" ]; then
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   103
		errlog "No lease_file specified, exiting"
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   104
		return 1
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   105
	fi
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   106
	if [ ! -f "$LEASEFILE" ]; then
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   107
		$TOUCH $LEASEFILE
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   108
		$CHMOD u=rw,go=r $LEASEFILE
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   109
	fi
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   110
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   111
	export OPTIONS="$OPTIONS -cf $CONFIGFILE -lf $LEASEFILE $LISTENIFNAMES"
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   112
	return 0
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   113
}
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   114
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   115
get_dhcprelay_options_v4() {
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   116
	#
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   117
	# Get append_agent_option V4 property value 
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   118
	#
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   119
	if [ "`get_prop append_agent_option`" = "true" ]; then
722
db6c773d591a 7143416 setting config/append_agent_option to true prevents dhcrelay from starting
Krishnan Chandrashekar <Krishnan.Chandrashekar@oracle.COM>
parents: 280
diff changeset
   120
		APPEND="-m append"
280
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   121
	else
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   122
		APPEND=""
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   123
	fi
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   124
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   125
	#
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   126
	# get listen_ifname property value and modify it.  
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   127
	# If listen_ifnames property value is "e1000g01 iprb0" then the
722
db6c773d591a 7143416 setting config/append_agent_option to true prevents dhcrelay from starting
Krishnan Chandrashekar <Krishnan.Chandrashekar@oracle.COM>
parents: 280
diff changeset
   128
	# command line option will look like  "-i e1000g0 -i iprb0"
280
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   129
	#
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   130
	LISTENIFNAMES="`get_prop listen_ifnames`"
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   131
	IIFLIST=""
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   132
	if [ ! -z "$LISTENIFNAMES" ]; then
722
db6c773d591a 7143416 setting config/append_agent_option to true prevents dhcrelay from starting
Krishnan Chandrashekar <Krishnan.Chandrashekar@oracle.COM>
parents: 280
diff changeset
   133
		IIFLIST="-i `echo $LISTENIFNAMES | sed -e 's/[ \t]/ -i /g'`"
280
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   134
	fi
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   135
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   136
	#
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   137
	# Get servers  V4 property value - command line option will look
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   138
	# like  "1.2.3.5 4.5.6.7".
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   139
	#
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   140
	# NOTE: By default server property value is empty. User must
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   141
	# first specify a server using svccfg/setprop command
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   142
	# before enabling service.
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   143
	#
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   144
	DHCPSERVERS=`get_prop servers`
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   145
	if [  -z "$DHCPSERVERS" ]; then
722
db6c773d591a 7143416 setting config/append_agent_option to true prevents dhcrelay from starting
Krishnan Chandrashekar <Krishnan.Chandrashekar@oracle.COM>
parents: 280
diff changeset
   146
		errlog 'Must specify at least one "servers" property value, exiting'
280
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   147
		return 1
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   148
	fi
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   149
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   150
	export OPTIONS="$OPTIONS -4 $APPEND $IIFLIST $DHCPSERVERS"
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   151
	return 0
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   152
}
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   153
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   154
get_dhcprelay_options_v6() {
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   155
	#
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   156
	# Get receivelinks  V6 property value and modify it:
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   157
	# Given property values of "1.2.3.4%bge0#1 bge2,1.2.3.4%iprb",
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   158
	# the command line option will look like  "-l 1.2.3.4%bge0#1 -l
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   159
	# bge2 -l 1.2.3.4%iprb".
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   160
	#
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   161
	# NOTE: By default receivelinks value is empty. User must
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   162
	# first specify a server using svccfg/setprop command
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   163
	# before enabling service.
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   164
	#
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   165
	RECVLINKS=`get_prop receive_query_links`
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   166
	if [  -z "$RECVLINKS" ]; then
722
db6c773d591a 7143416 setting config/append_agent_option to true prevents dhcrelay from starting
Krishnan Chandrashekar <Krishnan.Chandrashekar@oracle.COM>
parents: 280
diff changeset
   167
        	errlog 'Must specify at least one "receive_query_links" property value'
280
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   168
		errlog "Exiting."
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   169
		return 1
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   170
	fi
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   171
	IRECVLINKS=""
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   172
	if [ ! -z "$RECVLINKS" ]; then
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   173
		IRECVLINKS="-l `echo $RECVLINKS | sed -e 's/[ \t]/ -l /g'`"
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   174
	fi
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   175
	#
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   176
	# Get forwardlinks V6 property value and modify it:
722
db6c773d591a 7143416 setting config/append_agent_option to true prevents dhcrelay from starting
Krishnan Chandrashekar <Krishnan.Chandrashekar@oracle.COM>
parents: 280
diff changeset
   177
	# Given forward_query_links property value is "1.2.3.4%bge0 bge2,"
280
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   178
	# then the command line option will look like  "-u 1.2.3.4%bge0 -u
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   179
	# bge2"
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   180
	#
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   181
	# NOTE: By default forwardlinks value is empty. User must
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   182
	# first specify a server using svccfg/setprop command
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   183
	# before enabling service.
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   184
	#
722
db6c773d591a 7143416 setting config/append_agent_option to true prevents dhcrelay from starting
Krishnan Chandrashekar <Krishnan.Chandrashekar@oracle.COM>
parents: 280
diff changeset
   185
	FWDLINKS=`get_prop forward_query_links`
280
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   186
	if [ -z "$FWDLINKS" ]; then
722
db6c773d591a 7143416 setting config/append_agent_option to true prevents dhcrelay from starting
Krishnan Chandrashekar <Krishnan.Chandrashekar@oracle.COM>
parents: 280
diff changeset
   187
        	errlog 'Must specify at least one "forward_query_links" property value'
280
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   188
		errlog "Exiting"
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   189
		return 1
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   190
	fi
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   191
	IFWDLINKS=""
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   192
	if [ ! -z "$FWDLINKS" ]; then
722
db6c773d591a 7143416 setting config/append_agent_option to true prevents dhcrelay from starting
Krishnan Chandrashekar <Krishnan.Chandrashekar@oracle.COM>
parents: 280
diff changeset
   193
		IFWDLINKS="-u `echo $FWDLINKS | sed -e 's/[ \t]/ -u /g'`"
280
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   194
	fi
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   195
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   196
	export OPTIONS="$OPTIONS -6 $IRECVLINKS $IFWDLINKS"
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   197
}
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   198
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   199
export OPTIONS="--no-pid"
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   200
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   201
case "$SMF_FMRI" in
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   202
"$DHCPD_IPV4"|"$DHCPD_IPV6")
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   203
	get_common_options
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   204
	if [ "$?" != "0" ]; then
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   205
		exit $SMF_EXIT_ERR_CONFIG
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   206
	fi
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   207
	get_dhcpd_options
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   208
	if [ "$?" != "0" ]; then
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   209
		exit $SMF_EXIT_ERR_CONFIG
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   210
	fi
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   211
	if [ "$SMF_FMRI" = "$DHCPD_IPV4" ]; then
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   212
		OPTIONS="-4 $OPTIONS"
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   213
	else
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   214
		OPTIONS="-6 $OPTIONS"
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   215
	fi
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   216
	export EXECFILE=$DHCPD_BIN
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   217
	;;
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   218
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   219
$DHCPRELAY_IPV4)
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   220
	get_common_options
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   221
	if [ $? != "0" ]; then
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   222
		exit $SMF_EXIT_ERR_CONFIG
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   223
	fi
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   224
	get_dhcprelay_options_v4
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   225
	if [ $? != "0" ]; then
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   226
		exit $SMF_EXIT_ERR_CONFIG
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   227
	fi
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   228
	export EXECFILE=$DHCPRELAY_BIN
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   229
	;;
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   230
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   231
$DHCPRELAY_IPV6)
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   232
	get_common_options
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   233
	if [ $? != "0" ]; then
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   234
		exit $SMF_EXIT_ERR_CONFIG
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   235
	fi
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   236
	get_dhcprelay_options_v6
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   237
	if [ $? != "0" ]; then
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   238
		exit $SMF_EXIT_ERR_CONFIG
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   239
	fi
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   240
	export EXECFILE=$DHCPRELAY_BIN
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   241
	;;
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   242
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   243
*)
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   244
        echo "isc-dhcp must be invoked from within SMF"
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   245
        exit $SMF_EXIT_ERR_FATAL
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   246
	;;
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   247
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   248
esac
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   249
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   250
# Now start the daemon
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   251
if [ "$DEBUG" = "-d" ]; then
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   252
	$EXECFILE $OPTIONS &
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   253
else
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   254
	$EXECFILE $OPTIONS
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   255
fi
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   256
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   257
if [ "$?" != "0" ]; then
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   258
	exit $SMF_EXIT_ERR_FATAL
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   259
fi
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   260
c0dae1e3ca2f PSARC 2011/043 Import ISC DHCP
Rishi Srivatsavai <Rishi.Srivatsavai@oracle.com>
parents:
diff changeset
   261
exit $SMF_EXIT_OK