diff options
Diffstat (limited to 'mandriva/lookupdm')
-rwxr-xr-x | mandriva/lookupdm | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/mandriva/lookupdm b/mandriva/lookupdm new file mode 100755 index 00000000..8e8287e1 --- /dev/null +++ b/mandriva/lookupdm @@ -0,0 +1,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 |