xref: /titanic_41/usr/src/cmd/dcs/sparc/sun4u/svc-dcs (revision 1ae0874509b6811fdde1dfd46f0d93fd09867a3f)
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"
53fjopl="FJSV,SPARC-Enterprise"
54tmpopl="SUNW,OPL-Enterprise"
55
56args=""
57if [ $platform = "$sf15k" ]; then
58	args="$args `getproparg -a dcs/ah_auth`"
59	args="$args `getproparg -e dcs/esp_encr`"
60	args="$args `getproparg -u dcs/esp_auth`"
61elif [ $platform = "$opl" -o \
62       $platform = "$fjopl" -o \
63       $platform = "$tmpopl" ]; then
64	args="-l"
65fi
66
67if [ $platform = "$e10k" -o $platform = "$sf15k" -o \
68     $platform = "$opl" -o \
69     $platform = "$fjopl" -o \
70     $platform = "$tmpopl" ]; then
71	$DCS $args			# Fail if can't execute
72	exit				# Use dcs's exit status
73else
74	echo "$SMF_FMRI is not supported on this platform."
75	exit $SMF_EXIT_ERR_CONFIG
76fi
77
78exit 0
79