aboutsummaryrefslogtreecommitdiffstats
path: root/prefdm
blob: b014f56a726be54d0bb453f940fb11afeb3e6591 (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
#!/bin/sh

# Set preferred X display manager link
preferred=
if [ -f /etc/sysconfig/desktop ]; then
	if [ -n "grep GNOME /etc/sysconfig/desktop" ]; then
		preferred=gdm
	elif [ -n "grep KDE /etc/sysconfig/desktop" ]; then
		preferred=kdm
	elif [ -n "grep AnotherLevel /etc/sysconfig/desktop" ]; then
                preferred=xdm
	fi
fi
if [ -z "$preferred" ]; then
	if which gdm >/dev/null 2>&1; then
		preferred=gdm
	elif which kdm >/dev/null 2>&1; then
		preferred=kdm
	elif which xdm >/dev/null 2>&1; then
		preferred=xdm
	fi
fi
if [ -n "$preferred" ] && which $preferred ; then 
	exec `which $preferred` $*
fi
exit 1