dtstart revision 12508
#!/bin/ksh
#
# Script for starting a desktop session
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License, Version 1.0 only
# (the "License"). You may not use this file except in compliance
# with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
DT_SYS_CONFIG_DIR=/usr/dt/config
DT_SITE_CONFIG_DIR=/etc/dt/config
MYNAME=$(basename $0)
usage() {
echo "Usage: $0 session_name"
echo " session_name is the suffix of an Xinitrc script in"
echo " $DT_SITE_CONFIG_DIR (local configuration location) or"
echo " $DT_SYS_CONFIG_DIR (system default location)."
}
if [ $# -ne 1 ]; then
usage
exit 1
fi
case "$1" in
-h|--help|-\?)
usage
exit 0
;;
esac
SESSION_NAME="$1"
if [ -x "${DT_SITE_CONFIG_DIR}/Xinitrc.${SESSION_NAME}" ]; then
XINITRC="${DT_SITE_CONFIG_DIR}/Xinitrc.${SESSION_NAME}"
elif [ -x "${DT_SYS_CONFIG_DIR}/Xinitrc.${SESSION_NAME}" ]; then
XINITRC="${DT_SYS_CONFIG_DIR}/Xinitrc.${SESSION_NAME}"
else
echo "$MYNAME: Xinitrc.${SESSION_NAME} not found in ${DT_SITE_CONFIG_DIR} or ${DT_SYS_CONFIG_DIR}" 1>&2
exit 1
fi
#Startup Input methods (IIIM->XIM)
if [ -f /etc/iiim/xsession ]; then
. /etc/iiim/xsession
fi
# Use ssh-agent if available.
#
if [ -x "/usr/bin/ssh-agent" ] && [ -z "$SSH_AUTH_SOCK" ]; then
XINITRC="/usr/bin/ssh-agent -- $XINITRC"
else
echo "$0: ssh-agent not found."
fi
exec $XINITRC