xref: /illumos-gate/usr/src/cmd/dcs/sparc/sun4u/svc-dcs (revision 7f7322febbcfe774b7270abc3b191c094bfcc517)
1#!/sbin/sh
2#
3# Copyright 2005 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, Version 1.0 only
10# (the "License").  You may not use this file except in compliance
11# with the License.
12#
13# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
14# or http://www.opensolaris.org/os/licensing.
15# See the License for the specific language governing permissions
16# and limitations under the License.
17#
18# When distributing Covered Code, include this CDDL HEADER in each
19# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
20# If applicable, add the following below this CDDL HEADER, with the
21# fields enclosed by brackets "[]" replaced with your own identifying
22# information: Portions Copyright [yyyy] [name of copyright owner]
23#
24# CDDL HEADER END
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28# Start script for dcs
29#
30# For modifying parameters passed to dcs, do not edit
31# this script. Instead use svccfg(1m) to modify the SMF
32# repository. For example:
33#
34# svccfg
35# svc:> select platform/sun4u/dcs
36# svc:/platform/sun4u/dcs> setprop dcs/ah_auth = "md5"
37# svc:/platform/sun4u/dcs> exit
38
39
40. /lib/svc/share/smf_include.sh
41
42FMRI=svc:/platform/sun4u/dcs
43
44getproparg() {
45	val=`svcprop -p $2 $FMRI`
46	[ -n "$val" ] && [ "$val" != 'none' ] &&  echo $1 $val
47}
48
49DCS=/usr/lib/dcs
50platform=`/sbin/uname -i`
51starfire="SUNW,Ultra-Enterprise-10000"
52starcat="SUNW,Sun-Fire-15000"
53
54args=""
55if [ $platform = "$starcat" ]; 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`"
59fi
60
61if [ $platform = "$starfire" -o $platform = "$starcat" ]; then
62	$DCS $args			# Fail if can't execute
63	exit				# Use dcs's exit status
64else
65	echo "$SMF_FMRI is not supported on this platform."
66	exit $SMF_EXIT_ERR_CONFIG
67fi
68
69exit 0
70