#!/bin/ksh -p
#
# ident "@(#)PreSessionDefault.ksh	1.10	10/02/19 SMI"
#
# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
# Note that any setup should come before the sessreg command as
# iterate over the helpers directory then execute last helper
# that must be 'exec'ed for the pid to be correct (sessreg uses the parent
# pid)
#
# Note that output goes into the .xsession-errors file for easy debugging
#

PATH="/usr/bin/X11:/usr/X11R6/bin:/opt/X11R6/bin:$PATH:/bin:/usr/bin"

for i in /etc/opt/SUNWut/gdm/SunRayPreSession/helpers/*
do
	if [ -x $i ]; then
	    . $i
	fi
done

if [ `uname -s` = Linux ]; then
	# XXX it would be better to test the version of GDM, and
	# XXX execute this next line only if GDM version < 2.19.4
	# XXX What's a cheap way to test (i.e. no runtime gdm query)?
	exec /etc/opt/SUNWut/gdm/SunRayPreSession/SessReg
fi

exit 0
