xref: /illumos-gate/usr/src/cmd/dcs/sparc/sun4u/svc-dcs (revision fec509a05ddbf645268fe2e537314def7d1b67c8)
1#!/sbin/sh
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/OPENSOLARIS.LICENSE
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/OPENSOLARIS.LICENSE.
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	"%Z%%M%	%I%	%E% SMI"
28#
29# Start script for dcs
30#
31# For modifying parameters passed to dcs, do not edit
32# this script. Instead use svccfg(1m) to modify the SMF
33# repository. For example:
34#
35# svccfg
36# svc:> select platform/sun4u/dcs
37# svc:/platform/sun4u/dcs> setprop dcs/ah_auth = "md5"
38# svc:/platform/sun4u/dcs> exit
39
40
41. /lib/svc/share/smf_include.sh
42
43getproparg() {
44	val=`svcprop -p $2 $SMF_FMRI`
45	[ -n "$val" ] && [ "$val" != 'none' ] &&  echo $1 $val
46}
47
48DCS=/usr/lib/dcs
49platform=`/sbin/uname -i`
50e10k="SUNW,Ultra-Enterprise-10000"
51sf15k="SUNW,Sun-Fire-15000"
52opl="SUNW,SPARC-Enterprise"
53
54args=""
55if [ $platform = "$sf15k" ]; then
56	args="$args `getproparg -a dcs/ah_auth`"
57	args="$args `getproparg -e dcs/esp_encr`"
58	args="$args `getproparg -u dcs/esp_auth`"
59elif [ $platform = "$opl" ]; then
60	args="-l"
61fi
62
63if [ $platform = "$e10k" -o $platform = "$sf15k" -o \
64     $platform = "$opl" ]; then
65	$DCS $args			# Fail if can't execute
66	exit				# Use dcs's exit status
67else
68	echo "$SMF_FMRI is not supported on this platform."
69	exit $SMF_EXIT_ERR_CONFIG
70fi
71
72exit 0
73