[1108] | 1 | #!/bin/sh |
---|
| 2 | |
---|
| 3 | PATH=/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 | |
---|
| 10 | preferred= |
---|
| 11 | quit_arg= |
---|
| 12 | if [ -f /etc/sysconfig/dmtype ]; then |
---|
[8512] | 13 | if grep -q lightdm /etc/sysconfig/dmtype 2>/dev/null; then |
---|
| 14 | preferred=lightdm |
---|
| 15 | elif grep -q gdm /etc/sysconfig/dmtype 2>/dev/null; then |
---|
[1108] | 16 | preferred=gdm |
---|
| 17 | elif grep -q lxdm /etc/sysconfig/dmtype 2>/dev/null; then |
---|
| 18 | preferred=lxdm |
---|
| 19 | elif grep -q -e kdm -e kdm2 -e kde -e kde2 /etc/sysconfig/dmtype 2>/dev/null; then |
---|
| 20 | preferred=kdm |
---|
| 21 | elif grep -q wdm /etc/sysconfig/dmtype 2>/dev/null; then |
---|
| 22 | preferred=wdm |
---|
| 23 | elif grep -q xdm /etc/sysconfig/dmtype 2>/dev/null; then |
---|
| 24 | preferred=xdm |
---|
| 25 | fi |
---|
| 26 | fi |
---|
| 27 | |
---|
| 28 | if [ -z "$preferred" ]; then |
---|
[8512] | 29 | if which lightdm >/dev/null 2>&1; then |
---|
| 30 | preferred=lightdm |
---|
| 31 | elif which gdm >/dev/null 2>&1; then |
---|
[1108] | 32 | preferred=gdm |
---|
| 33 | elif which lxdm >/dev/null 2>&1; then |
---|
| 34 | preferred=lxdm |
---|
| 35 | elif which kdm >/dev/null 2>&1; then |
---|
| 36 | preferred=kdm |
---|
| 37 | elif which wdm >/dev/null 2>&1; then |
---|
| 38 | preferred=wdm |
---|
| 39 | elif which xdm >/dev/null 2>&1; then |
---|
| 40 | preferred=xdm |
---|
| 41 | fi |
---|
| 42 | fi |
---|
| 43 | |
---|
| 44 | # shut down boot splash |
---|
[2969] | 45 | [ -x /usr/bin/plymouth ] && /usr/bin/plymouth quit |
---|
[1108] | 46 | |
---|
| 47 | if [ -n "$preferred" ] && which $preferred >/dev/null 2>&1; then |
---|
| 48 | exec `which $preferred` $* >/dev/null 2>&1 |
---|
| 49 | fi |
---|
| 50 | |
---|
[8512] | 51 | if which lightdm >/dev/null 2>&1; then |
---|
| 52 | exec `which lightdm` $* >/dev/null 2>&1 |
---|
| 53 | elif which gdm >/dev/null 2>&1; then |
---|
[1108] | 54 | exec `which gdm` $* >/dev/null 2>&1 |
---|
| 55 | elif which lxdm >/dev/null 2>&1; then |
---|
| 56 | exec `which lxdm` $* >/dev/null 2>&1 |
---|
| 57 | elif which kdm >/dev/null 2>&1; then |
---|
| 58 | exec `which kdm` $* >/dev/null 2>&1 |
---|
| 59 | elif which xdm >/dev/null 2>&1; then |
---|
| 60 | exec `which xdm` $* >/dev/null 2>&1 |
---|
| 61 | fi |
---|
| 62 | |
---|
| 63 | # catch all exit error |
---|
| 64 | exit 1 |
---|