xref: /titanic_53/usr/src/cmd/svc/milestone/console-login (revision a1e4d62bc1ea0bd683c63f185da43cda7aec8f20)
17c478bd9Sstevel@tonic-gate#!/sbin/sh
27c478bd9Sstevel@tonic-gate#
37c478bd9Sstevel@tonic-gate# CDDL HEADER START
47c478bd9Sstevel@tonic-gate#
57c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
6fea9cb91Slq150181# Common Development and Distribution License (the "License").
7fea9cb91Slq150181# You may not use this file except in compliance with the License.
87c478bd9Sstevel@tonic-gate#
97c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
117c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
127c478bd9Sstevel@tonic-gate# and limitations under the License.
137c478bd9Sstevel@tonic-gate#
147c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
157c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
177c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
187c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
197c478bd9Sstevel@tonic-gate#
207c478bd9Sstevel@tonic-gate# CDDL HEADER END
217c478bd9Sstevel@tonic-gate#
22fea9cb91Slq150181
237c478bd9Sstevel@tonic-gate#
24fea9cb91Slq150181# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
257c478bd9Sstevel@tonic-gate# Use is subject to license terms.
267c478bd9Sstevel@tonic-gate#
277c478bd9Sstevel@tonic-gate# ident	"%Z%%M%	%I%	%E% SMI"
287c478bd9Sstevel@tonic-gate#
297c478bd9Sstevel@tonic-gate# For modifying parameters passed to ttymon, do not edit
307c478bd9Sstevel@tonic-gate# this script. Instead use svccfg(1m) to modify the SMF
317c478bd9Sstevel@tonic-gate# repository. For example:
327c478bd9Sstevel@tonic-gate#
337c478bd9Sstevel@tonic-gate# # svccfg
347c478bd9Sstevel@tonic-gate# svc:> select system/console-login
357c478bd9Sstevel@tonic-gate# svc:/system/console-login> setprop ttymon/terminal_type = "xterm"
367c478bd9Sstevel@tonic-gate# svc:/system/console-login> exit
377c478bd9Sstevel@tonic-gate
387c478bd9Sstevel@tonic-gategetproparg() {
39*a1e4d62bShshaw	val=`svcprop -p $2 $SMF_FMRI`
40fea9cb91Slq150181	[ -n "$val" ] && [ "$val" != "\"\"" ] && echo $1 $val
417c478bd9Sstevel@tonic-gate}
427c478bd9Sstevel@tonic-gate
437c478bd9Sstevel@tonic-gateargs="-g"
447c478bd9Sstevel@tonic-gate
45*a1e4d62bShshawval=`svcprop -p ttymon/device $SMF_FMRI`
467c478bd9Sstevel@tonic-gate# if this isn't set, recover a little
477c478bd9Sstevel@tonic-gate[ -z "$val" ] && val=/dev/console
487c478bd9Sstevel@tonic-gateargs="$args -d $val"
497c478bd9Sstevel@tonic-gate
507c478bd9Sstevel@tonic-gateargs="$args `getproparg -l ttymon/label`"
51fea9cb91Slq150181
527c478bd9Sstevel@tonic-gateargs="$args `getproparg -T ttymon/terminal_type`"
53fea9cb91Slq150181
547c478bd9Sstevel@tonic-gateargs="$args `getproparg -m ttymon/modules`"
557c478bd9Sstevel@tonic-gate
56*a1e4d62bShshawval=`svcprop -p ttymon/nohangup $SMF_FMRI`
577c478bd9Sstevel@tonic-gate[ "$val" = "true" ] && args="$args -h"
587c478bd9Sstevel@tonic-gate
59*a1e4d62bShshawval=`svcprop -p ttymon/timeout $SMF_FMRI`
607c478bd9Sstevel@tonic-gate[ -n "$val" -a "$val" != "0" ] && args="$args -t $val"
617c478bd9Sstevel@tonic-gate
62*a1e4d62bShshawval=`svcprop -p ttymon/prompt $SMF_FMRI`
637c478bd9Sstevel@tonic-gateif [ -n "$val" ]; then
647c478bd9Sstevel@tonic-gate	prompt=`eval echo $val`
657c478bd9Sstevel@tonic-gate	exec /usr/lib/saf/ttymon $args -p "`eval echo $prompt` "
667c478bd9Sstevel@tonic-gateelse
677c478bd9Sstevel@tonic-gate	exec /usr/lib/saf/ttymon $args
687c478bd9Sstevel@tonic-gatefi
69