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