1604N/A# Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved. 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# 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# 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/AUSAGE=
"Usage: $0 [-c <class>] :<display> [<X server arguments>]" 970N/A# Users must not modify this script to change them - change via SMF properties 970N/A # Strip leading ":" from $1 to get display number 970N/Aif [[
"${REMOTE}" ==
"true" ]] ;
then 970N/A# 1) name of SMF property to find in one of the service instances 970N/A# 2) name of variable to store the value of the property in, if found 970N/A# Also sets variable with name of $2_INSTANCE to the service instance the 970N/A# property was found in, for use in later messages. 970N/A # Make ${propval} be a reference to the variable named as the second arg 970N/A # The "" instance is to get the properties from the base service without 970N/A # any instance specifier 970N/A if [[ "${propval}" == "\"\"" ]] ; then 1604N/A# Get the platform name that uses Xvnc instead of Xorg and clean it up. 1623N/A# Determine if this is a supported platform for VNC. 1623N/Aif [[ ("${hwname}" != "") ]]; then 1657N/Aif [[ ("${ISVNCPLATFORM}" != "true") && (-e "${MDESC}") ]]; then 1604N/A# Check if this is a platform that should use Xvnc or Xorg. 1604N/A # Configure x11-server to run Xvnc instead of Xorg for ${VNCPLATFORM} 1604N/A SERVERARGS="-SecurityTypes=TLSNone -DisconnectClients=false -NeverShared -IdleTimeout=3600 -interface 169.254.182.77 -screenlock" 1604N/A # Need single quotes due to some shells having issue with spaces. 1604N/A options/server_args = astring: '"-SecurityTypes=TLSNone -DisconnectClients=false -NeverShared -IdleTimeout=3600 -interface 169.254.182.77 -screenlock"' 1604N/A # This check is needed in case the system is booted from a cloned archive. 1623N/A if ! ${ISVNCPLATFORM} ; then 970N/AORIGINAL_XSERVER="${XSERVER}" 970N/Aif [[ -f ${XSERVER} ]] ; then 970N/A # via the /usr/X -> openwin or X11 link 970N/A # Automatically select replacements for removed X servers 970N/A# Make sure ${XSERVER} is a known X server binary 970N/A if [[
"${DEFDEPTH}" !=
"" ]] ;
then 970N/A# Should not happen, but just in case 970N/Aif [[
"${TCP_LISTEN}" ==
"" ]] ;
then 970N/A if [[
"${REMOTE}" ==
"true" ]] ;
then 970N/Aif [[
"${TCP_LISTEN}" ==
"false" ]] ;
then 970N/Aif [[
("${CONSOLE}" == "true") &&
("${DISPLAY}" == "0") ]] ;
then 1018N/A# Currently only Xorg accepts a command line flag for choosing config files. 1018N/A# If other X servers add such flags in the future, they should be added here. 1018N/A# Only filenames without directory paths are allowed (similar to when a 1018N/A# non-root user runs Xorg -config) to avoid security issues. 1018N/Aif [[ ! -z
"${CONFIG_FILE}" ]] ;
then 1018N/AALLARGS=
"${DEPTHARG} ${LISTENARG} ${SERVERARGS} ${CONSOLE} ${CONFIGARG} $*" 1604N/A# Remove unneeded arguments for Xvnc. 970N/Aexec ${XSERVER} :${DISPLAY} ${ALLARGS}