source: projects/initscripts/tags/initscripts-8.90.6/prefdm @ 1108

Revision 1108, 1.7 KB checked in by daisuke, 14 years ago (diff)

import initscripts-8.90.6 from internal cvs repository

Line 
1#!/bin/sh
2
3PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
4
5# We need to source this so that the login screens get translated
6. /etc/profile.d/lang.sh
7
8# Run preferred X display manager
9
10preferred=
11quit_arg=
12if [ -f /etc/sysconfig/dmtype ]; then
13        if grep -q gdm /etc/sysconfig/dmtype 2>/dev/null; then
14                preferred=gdm
15                quit_arg="--retain-splash"
16        elif grep -q lxdm /etc/sysconfig/dmtype 2>/dev/null; then
17                preferred=lxdm
18                quit_arg="--retain-splash"
19        elif grep -q -e kdm -e kdm2 -e kde -e kde2 /etc/sysconfig/dmtype 2>/dev/null; then
20                preferred=kdm
21                quit_arg="--retain-splash"
22        elif grep -q wdm /etc/sysconfig/dmtype 2>/dev/null; then
23                preferred=wdm
24        elif grep -q xdm /etc/sysconfig/dmtype 2>/dev/null; then
25                preferred=xdm
26        else
27                quit_arg="--retain-splash"
28        fi
29else
30        quit_arg="--retain-splash"
31fi
32
33if [ -z "$preferred" ]; then
34        if which gdm >/dev/null 2>&1; then
35                preferred=gdm
36                quit_arg="--retain-splash"
37        elif which lxdm >/dev/null 2>&1; then
38                preferred=lxdm
39                quit_arg="--retain-splash"
40        elif which kdm >/dev/null 2>&1; then
41                preferred=kdm
42                quit_arg="--retain-splash"
43        elif which wdm >/dev/null 2>&1; then
44                preferred=wdm
45        elif which xdm >/dev/null 2>&1; then
46                preferred=xdm
47        fi
48fi
49
50# shut down boot splash
51[ -x /usr/bin/plymouth ] && /usr/bin/plymouth quit $quit_arg
52
53if [ -n "$preferred" ] && which $preferred >/dev/null 2>&1; then
54        exec `which $preferred` $* >/dev/null 2>&1
55fi
56
57if which gdm >/dev/null 2>&1; then
58        exec `which gdm` $* >/dev/null 2>&1
59elif which lxdm >/dev/null 2>&1; then
60        exec `which lxdm` $* >/dev/null 2>&1
61elif which kdm >/dev/null 2>&1; then
62        exec `which kdm` $* >/dev/null 2>&1
63elif which xdm >/dev/null 2>&1; then
64        exec `which xdm` $* >/dev/null 2>&1
65fi
66
67# catch all exit error
68exit 1
Note: See TracBrowser for help on using the repository browser.