#!/bin/ksh -p
#
# ident "@(#)utgdmconfigpath.ksh	1.6	12/06/29 Oracle"
#
# Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
#
PATH=/usr/bin:/bin:/usr/sbin:/sbin
export PATH

UTWHICH=/opt/SUNWut/lib/utwhich

gdm_search_path=/etc/gdm:/etc/X11/gdm

if ! gdm_path=$($UTWHICH -f $gdm_search_path custom.conf) \
	&& [[ "$(uname -s)" == "Linux" ]]; then
    gdm_path=$(rpm -ql "gdm" | grep "custom.conf")
fi

if [[ -z "$gdm_path" ]] ; then
	echo "$(basename $0): Cannot determine GDM install directory" 1>&2
	exit 1;
fi

echo ${gdm_path%/custom.conf}/

exit 0
