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 6*fea9cb91Slq150181# Common Development and Distribution License (the "License"). 7*fea9cb91Slq150181# 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# 22*fea9cb91Slq150181 237c478bd9Sstevel@tonic-gate# 24*fea9cb91Slq150181# 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-gateFMRI=svc:/system/console-login 397c478bd9Sstevel@tonic-gate 407c478bd9Sstevel@tonic-gategetproparg() { 417c478bd9Sstevel@tonic-gate val=`svcprop -p $2 $FMRI` 42*fea9cb91Slq150181 [ -n "$val" ] && [ "$val" != "\"\"" ] && echo $1 $val 437c478bd9Sstevel@tonic-gate} 447c478bd9Sstevel@tonic-gate 457c478bd9Sstevel@tonic-gateargs="-g" 467c478bd9Sstevel@tonic-gate 477c478bd9Sstevel@tonic-gateval=`svcprop -p ttymon/device $FMRI` 487c478bd9Sstevel@tonic-gate# if this isn't set, recover a little 497c478bd9Sstevel@tonic-gate[ -z "$val" ] && val=/dev/console 507c478bd9Sstevel@tonic-gateargs="$args -d $val" 517c478bd9Sstevel@tonic-gate 527c478bd9Sstevel@tonic-gateargs="$args `getproparg -l ttymon/label`" 53*fea9cb91Slq150181 547c478bd9Sstevel@tonic-gateargs="$args `getproparg -T ttymon/terminal_type`" 55*fea9cb91Slq150181 567c478bd9Sstevel@tonic-gateargs="$args `getproparg -m ttymon/modules`" 577c478bd9Sstevel@tonic-gate 587c478bd9Sstevel@tonic-gateval=`svcprop -p ttymon/nohangup $FMRI` 597c478bd9Sstevel@tonic-gate[ "$val" = "true" ] && args="$args -h" 607c478bd9Sstevel@tonic-gate 617c478bd9Sstevel@tonic-gateval=`svcprop -p ttymon/timeout $FMRI` 627c478bd9Sstevel@tonic-gate[ -n "$val" -a "$val" != "0" ] && args="$args -t $val" 637c478bd9Sstevel@tonic-gate 647c478bd9Sstevel@tonic-gateval=`svcprop -p ttymon/prompt $FMRI` 657c478bd9Sstevel@tonic-gateif [ -n "$val" ]; then 667c478bd9Sstevel@tonic-gate prompt=`eval echo $val` 677c478bd9Sstevel@tonic-gate exec /usr/lib/saf/ttymon $args -p "`eval echo $prompt` " 687c478bd9Sstevel@tonic-gateelse 697c478bd9Sstevel@tonic-gate exec /usr/lib/saf/ttymon $args 707c478bd9Sstevel@tonic-gatefi 71