Sophie

Sophie

distrib > Mandriva > 2010.1 > x86_64 > media > main-updates > by-pkgid > b37503e09ea539176fa3a2506fa8882d > files > 8

initscripts-8.99-16.1mdv2010.2.x86_64.rpm

#!/bin/sh
#---------------------------------------------------------------
# Project         : Mandriva Linux
# Module          : initscripts
# File            : lookupdm
# Version         : $Id$
# Author          : Frederic Lepied
# Created On      : Mon May 30 08:50:45 2005
# Purpose         : Lookup the display manager according to the
#                 argument or find the first available one.
#---------------------------------------------------------------

TARGET_DM=$1
DIR=/usr/share/X11/dm.d

if [ -n "$TARGET_DM" ]; then
    for f in `grep -l "^NAME=$TARGET_DM$" $DIR/*.conf`; do
	EXEC=
	eval `grep '^EXEC=' "$f"`
	if [ -x "$EXEC" ]; then
	    echo $EXEC
	    exit 0
	fi
    done
fi

for f in $DIR/*.conf; do
    EXEC=
    eval `grep '^EXEC=' "$f"`
    if [ -x "$EXEC" ]; then
	echo $EXEC
	exit 0
    fi
done

# lookupdm.sh ends here