aboutsummaryrefslogtreecommitdiffstats
path: root/mandriva/lookupdm
blob: 8e8287e12b1fa14dd0c9ba478829d9afefedc171 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh
#---------------------------------------------------------------
# Project         : Mageia
# 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