console-login revision a1e4d62bc1ea0bd683c63f185da43cda7aec8f20
2286N/A#!/sbin/sh
2286N/A#
2286N/A# CDDL HEADER START
2286N/A#
2286N/A# The contents of this file are subject to the terms of the
2286N/A# Common Development and Distribution License (the "License").
2286N/A# You may not use this file except in compliance with the License.
2286N/A#
2286N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2286N/A# or http://www.opensolaris.org/os/licensing.
2286N/A# See the License for the specific language governing permissions
2286N/A# and limitations under the License.
2286N/A#
2286N/A# When distributing Covered Code, include this CDDL HEADER in each
2286N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2286N/A# If applicable, add the following below this CDDL HEADER, with the
2286N/A# fields enclosed by brackets "[]" replaced with your own identifying
2286N/A# information: Portions Copyright [yyyy] [name of copyright owner]
2286N/A#
2286N/A# CDDL HEADER END
2286N/A#
2286N/A
2286N/A#
2286N/A# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
2286N/A# Use is subject to license terms.
2286N/A#
2286N/A# ident "%Z%%M% %I% %E% SMI"
2286N/A#
2286N/A# For modifying parameters passed to ttymon, do not edit
2286N/A# this script. Instead use svccfg(1m) to modify the SMF
2286N/A# repository. For example:
2286N/A#
2286N/A# # svccfg
2286N/A# svc:> select system/console-login
2286N/A# svc:/system/console-login> setprop ttymon/terminal_type = "xterm"
2286N/A# svc:/system/console-login> exit
2286N/A
2286N/Agetproparg() {
2286N/A val=`svcprop -p $2 $SMF_FMRI`
2286N/A [ -n "$val" ] && [ "$val" != "\"\"" ] && echo $1 $val
2286N/A}
2286N/A
2286N/Aargs="-g"
2286N/A
2286N/Aval=`svcprop -p ttymon/device $SMF_FMRI`
2286N/A# if this isn't set, recover a little
2286N/A[ -z "$val" ] && val=/dev/console
2286N/Aargs="$args -d $val"
2286N/A
2286N/Aargs="$args `getproparg -l ttymon/label`"
2286N/A
2286N/Aargs="$args `getproparg -T ttymon/terminal_type`"
2286N/A
2286N/Aargs="$args `getproparg -m ttymon/modules`"
2286N/A
2286N/Aval=`svcprop -p ttymon/nohangup $SMF_FMRI`
2286N/A[ "$val" = "true" ] && args="$args -h"
2286N/A
2286N/Aval=`svcprop -p ttymon/timeout $SMF_FMRI`
2286N/A[ -n "$val" -a "$val" != "0" ] && args="$args -t $val"
2286N/A
2286N/Aval=`svcprop -p ttymon/prompt $SMF_FMRI`
2286N/Aif [ -n "$val" ]; then
2286N/A prompt=`eval echo $val`
2286N/A exec /usr/lib/saf/ttymon $args -p "`eval echo $prompt` "
else
exec /usr/lib/saf/ttymon $args
fi