xref: /titanic_50/usr/src/cmd/dcs/sparc/sun4u/svc-dcs (revision f808c858fa61e7769218966759510a8b1190dfcf)
1#!/sbin/sh
2#
3# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
4# Use is subject to license terms.
5#
6# CDDL HEADER START
7#
8# The contents of this file are subject to the terms of the
9# Common Development and Distribution License (the "License").
10# You may not use this file except in compliance with the License.
11#
12# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
13# or http://www.opensolaris.org/os/licensing.
14# See the License for the specific language governing permissions
15# and limitations under the License.
16#
17# When distributing Covered Code, include this CDDL HEADER in each
18# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
19# If applicable, add the following below this CDDL HEADER, with the
20# fields enclosed by brackets "[]" replaced with your own identifying
21# information: Portions Copyright [yyyy] [name of copyright owner]
22#
23# CDDL HEADER END
24#
25# ident	"%Z%%M%	%I%	%E% SMI"
26#
27# Start script for dcs
28#
29# For modifying parameters passed to dcs, do not edit
30# this script. Instead use svccfg(1m) to modify the SMF
31# repository. For example:
32#
33# svccfg
34# svc:> select platform/sun4u/dcs
35# svc:/platform/sun4u/dcs> setprop dcs/ah_auth = "md5"
36# svc:/platform/sun4u/dcs> exit
37
38
39. /lib/svc/share/smf_include.sh
40
41FMRI=svc:/platform/sun4u/dcs
42
43getproparg() {
44	val=`svcprop -p $2 $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