10569
|
1 |
#!/bin/ksh
|
|
2 |
#
|
|
3 |
# Script for starting a desktop session
|
|
4 |
#
|
|
5 |
# CDDL HEADER START
|
|
6 |
#
|
|
7 |
# The contents of this file are subject to the terms of the
|
|
8 |
# Common Development and Distribution License, Version 1.0 only
|
|
9 |
# (the "License"). You may not use this file except in compliance
|
|
10 |
# with the License.
|
|
11 |
#
|
|
12 |
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
|
13 |
# or http://www.opensolaris.org/os/licensing.
|
|
14 |
# See the License for the specific language governing permissions
|
|
15 |
# and limitations under the License.
|
|
16 |
#
|
|
17 |
# When distributing Covered Code, include this CDDL HEADER in each
|
|
18 |
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
|
19 |
# If applicable, add the following below this CDDL HEADER, with the
|
|
20 |
# fields enclosed by brackets "[]" replaced with your own identifying
|
|
21 |
# information: Portions Copyright [yyyy] [name of copyright owner]
|
|
22 |
#
|
|
23 |
# CDDL HEADER END
|
|
24 |
#
|
|
25 |
#
|
|
26 |
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
|
|
27 |
# Use is subject to license terms.
|
|
28 |
#
|
|
29 |
|
|
30 |
DT_SYS_CONFIG_DIR=/usr/dt/config
|
|
31 |
DT_SITE_CONFIG_DIR=/etc/dt/config
|
|
32 |
MYNAME=$(basename $0)
|
|
33 |
|
|
34 |
usage() {
|
|
35 |
echo "Usage: $0 session_name"
|
|
36 |
echo " session_name is the suffix of an Xinitrc script in"
|
|
37 |
echo " $DT_SITE_CONFIG_DIR (local configuration location) or"
|
|
38 |
echo " $DT_SYS_CONFIG_DIR (system default location)."
|
|
39 |
}
|
|
40 |
|
|
41 |
if [ $# -ne 1 ]; then
|
|
42 |
usage
|
|
43 |
exit 1
|
|
44 |
fi
|
|
45 |
|
|
46 |
case "$1" in
|
|
47 |
-h|--help|-\?)
|
|
48 |
usage
|
|
49 |
exit 0
|
|
50 |
;;
|
|
51 |
esac
|
|
52 |
|
|
53 |
SESSION_NAME="$1"
|
|
54 |
|
|
55 |
if [ -x "${DT_SITE_CONFIG_DIR}/Xinitrc.${SESSION_NAME}" ]; then
|
|
56 |
XINITRC="${DT_SITE_CONFIG_DIR}/Xinitrc.${SESSION_NAME}"
|
|
57 |
elif [ -x "${DT_SYS_CONFIG_DIR}/Xinitrc.${SESSION_NAME}" ]; then
|
|
58 |
XINITRC="${DT_SYS_CONFIG_DIR}/Xinitrc.${SESSION_NAME}"
|
|
59 |
else
|
|
60 |
echo "$MYNAME: Xinitrc.${SESSION_NAME} not found in ${DT_SITE_CONFIG_DIR} or ${DT_SYS_CONFIG_DIR}" 1>&2
|
|
61 |
exit 1
|
|
62 |
fi
|
|
63 |
|
11766
|
64 |
#Startup Input methods (IIIM->XIM)
|
|
65 |
if [ -f /etc/iiim/xsession ]; then
|
|
66 |
. /etc/iiim/xsession
|
|
67 |
fi
|
|
68 |
|
10569
|
69 |
exec $XINITRC
|