1155N/A#!/bin/ksh93
970N/A#
1155N/A# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
970N/A#
970N/A# Permission is hereby granted, free of charge, to any person obtaining a
970N/A# copy of this software and associated documentation files (the "Software"),
970N/A# to deal in the Software without restriction, including without limitation
970N/A# the rights to use, copy, modify, merge, publish, distribute, sublicense,
970N/A# and/or sell copies of the Software, and to permit persons to whom the
970N/A# Software is furnished to do so, subject to the following conditions:
970N/A#
970N/A# The above copyright notice and this permission notice (including the next
970N/A# paragraph) shall be included in all copies or substantial portions of the
970N/A# Software.
970N/A#
970N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
970N/A# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
970N/A# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
970N/A# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
970N/A# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
970N/A# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
970N/A# DEALINGS IN THE SOFTWARE.
970N/A#
970N/A
970N/AUSAGE="Usage: $0 [-d <display>] [-c <class>] <method> [-- <X server arguments>]"
970N/A
1155N/APATH=/usr/bin:/usr/sbin
970N/A
970N/A#########
970N/A#
970N/A# Default values
970N/A#
970N/A# Users must not modify this script to change them - change via SMF properties
970N/A#
970N/A
970N/ADISPLAY="0"
970N/ACLASSES=""
970N/A
970N/Awhile getopts c:d: opt; do
970N/A case $opt in
1155N/A c) if [[ "$OPTARG" != "default" ]] ; then
970N/A CLASSES="$CLASSES -c $OPTARG"
970N/A fi ;;
970N/A d) DISPLAY="$OPTARG";;
970N/A ?) echo $USAGE ; exit 2;;
970N/A esac
970N/Adone
970N/A
970N/Ashift `expr $OPTIND - 1`
970N/A
970N/AMETHOD=$1
1155N/Aif [[ $# -lt 1 ]] ; then
1155N/A print -u2 $USAGE
970N/A exit 2
970N/Afi
970N/Ashift
970N/A
970N/Acase $METHOD in
970N/A start)
970N/A # Continue with rest of script
970N/A ;;
970N/A *)
970N/A echo "Invalid method $METHOD"
970N/A exit 2
970N/A ;;
970N/Aesac
970N/A
1155N/Aif [[ "$1" = "--" ]] ; then
970N/A shift
970N/Aelse
1155N/A if [[ "$1" != "" ]] ; then
970N/A echo $USAGE
970N/A exit 2
970N/A fi
970N/Afi
970N/A
970N/A# If the X server is started with SIGUSR1 set to ignore, then it
970N/A# sends SIGUSR1 to its parent process when it is ready to run
970N/AXserver_ready() {
970N/A exit 0
970N/A}
970N/A
970N/Atrap Xserver_ready USR1
970N/A(trap '' USR1 ; exec /usr/bin/Xserver $CLASSES :$DISPLAY $* &)
970N/A